• Re: compilation of sqlite3 on dos using djgpp

    From HILMAN AHWAS A.@21:1/5 to omitted on Wed Feb 22 06:57:15 2023
    On Monday, February 18, 2013 at 2:02:33 AM UTC+7, <@email omitted> wrote:
    Well, on a lazy Sunday afternoon I tried to compile SQLite too.

    The following steps allowed to compile it:

    1. run "configure --disable-threadsafe"

    2. modify this in sqlite3.c:

    #ifdef __DJGPP__
    { "fstat", 0, 0 },
    //#define osFstat(a,b,c) 0
    #define osFstat(a,b) 0 //djgpp - replacing above
    #define MAP_SHARED 0
    #define MAP_FAILED 0
    #define ETIMEDOUT 9000 //unused number
    #define ENOTCONN 9001 //unused number

    #else

    3. take out munmap:

    for(i=0; i<p->nRegion; i++){
    if( p->h>=0 ){
    //djgpp munmap(p->apRegion[i], p->szRegion);
    }else{
    sqlite3_free(p->apRegion[i]);
    }
    }

    4. take out mmap:

    if( pShmNode->h>=0 ){
    /* djgpp
    pMem = mmap(0, szRegion,
    pShmNode->isReadonly ? PROT_READ : PROT_READ|PROT_WRITE,
    MAP_SHARED, pShmNode->h, szRegion*(i64)pShmNode->nRegion
    );
    */
    if( pMem==MAP_FAILED ){
    rc = unixLogError(SQLITE_IOERR_SHMMAP, "mmap", pShmNode->zFilename);
    goto shmpage_out;
    }


    Then it did compile and seemed to work so far. The library does not use mmap, only the shell program sqlite3.exe does and I guess that will work so far without mmap in DOS.

    Georg

    Where do I place those lines of code?

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From [via djgpp@delorie.com]" @21:1/5 to djgpp@delorie.com] on Fri Feb 24 13:38:23 2023
    On 2/22/2023 9:57 AM, HILMAN AHWAS A. (hilmanahwaa@gmail.com) [via djgpp@delorie.com] wrote:
    On Monday, February 18, 2013 at 2:02:33 AM UTC+7, <@email omitted> wrote:
    Well, on a lazy Sunday afternoon I tried to compile SQLite too.

    The following steps allowed to compile it:

    1. run "configure --disable-threadsafe"

    2. modify this in sqlite3.c:

    #ifdef __DJGPP__
    { "fstat", 0, 0 },
    //#define osFstat(a,b,c) 0
    #define osFstat(a,b) 0 //djgpp - replacing above
    #define MAP_SHARED 0
    #define MAP_FAILED 0
    #define ETIMEDOUT 9000 //unused number
    #define ENOTCONN 9001 //unused number

    #else

    3. take out munmap:

    for(i=0; i<p->nRegion; i++){
    if( p->h>=0 ){
    //djgpp munmap(p->apRegion[i], p->szRegion);
    }else{
    sqlite3_free(p->apRegion[i]);
    }
    }

    4. take out mmap:

    if( pShmNode->h>=0 ){
    /* djgpp
    pMem = mmap(0, szRegion,
    pShmNode->isReadonly ? PROT_READ : PROT_READ|PROT_WRITE,
    MAP_SHARED, pShmNode->h, szRegion*(i64)pShmNode->nRegion
    );
    */
    if( pMem==MAP_FAILED ){
    rc = unixLogError(SQLITE_IOERR_SHMMAP, "mmap", pShmNode->zFilename);
    goto shmpage_out;
    }


    Then it did compile and seemed to work so far. The library does not use mmap, only the shell program sqlite3.exe does and I guess that will work so far without mmap in DOS.

    Georg
    Where do I place those lines of code?

    According to Georg's instructions sqlite3.c from the source code.

    Frank

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From HILMAN AHWAS A.@21:1/5 to djgpp@delorie.com] on Fri Aug 4 21:14:47 2023
    On Saturday, February 25, 2023 at 1:43:44 AM UTC+7, Frank Sapone (emo...@gmail.com) [via djgpp@delorie.com] wrote:
    On 2/22/2023 9:57 AM, HILMAN AHWAS A. (hilma...@gmail.com) [via dj...@delorie.com] wrote:
    On Monday, February 18, 2013 at 2:02:33 AM UTC+7, <@email omitted> wrote:
    Well, on a lazy Sunday afternoon I tried to compile SQLite too.

    The following steps allowed to compile it:

    1. run "configure --disable-threadsafe"

    2. modify this in sqlite3.c:

    #ifdef __DJGPP__
    { "fstat", 0, 0 },
    //#define osFstat(a,b,c) 0
    #define osFstat(a,b) 0 //djgpp - replacing above
    #define MAP_SHARED 0
    #define MAP_FAILED 0
    #define ETIMEDOUT 9000 //unused number
    #define ENOTCONN 9001 //unused number

    #else

    3. take out munmap:

    for(i=0; i<p->nRegion; i++){
    if( p->h>=0 ){
    //djgpp munmap(p->apRegion[i], p->szRegion);
    }else{
    sqlite3_free(p->apRegion[i]);
    }
    }

    4. take out mmap:

    if( pShmNode->h>=0 ){
    /* djgpp
    pMem = mmap(0, szRegion,
    pShmNode->isReadonly ? PROT_READ : PROT_READ|PROT_WRITE,
    MAP_SHARED, pShmNode->h, szRegion*(i64)pShmNode->nRegion
    );
    */
    if( pMem==MAP_FAILED ){
    rc = unixLogError(SQLITE_IOERR_SHMMAP, "mmap", pShmNode->zFilename);
    goto shmpage_out;
    }


    Then it did compile and seemed to work so far. The library does not use mmap, only the shell program sqlite3.exe does and I guess that will work so far without mmap in DOS.

    Georg
    Where do I place those lines of code?
    According to Georg's instructions sqlite3.c from the source code.

    Frank

    In what line numbers? I've obtained the 3.42.0 amalgamation source code

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From [via djgpp@delorie.com]" @21:1/5 to djgpp@delorie.com] on Sat Aug 5 11:58:02 2023
    ------- Original Message -------
    On Wednesday, February 22nd, 2023 at PM 10:57, HILMAN AHWAS A. (hilmanahwaa@gmail.com) [via djgpp@delorie.com] <djgpp@delorie.com> wrote:


    On Monday, February 18, 2013 at 2:02:33 AM UTC+7, <@email omitted> wrote:

    Well, on a lazy Sunday afternoon I tried to compile SQLite too.

    The following steps allowed to compile it:

    1. run "configure --disable-threadsafe"

    2. modify this in sqlite3.c:

    #ifdef DJGPP
    { "fstat", 0, 0 },
    //#define osFstat(a,b,c) 0
    #define osFstat(a,b) 0 //djgpp - replacing above
    #define MAP_SHARED 0
    #define MAP_FAILED 0
    #define ETIMEDOUT 9000 //unused number
    #define ENOTCONN 9001 //unused number

    #else

    3. take out munmap:

    for(i=0; i<p->nRegion; i++){
    if( p->h>=0 ){
    //djgpp munmap(p->apRegion[i], p->szRegion);
    }else{
    sqlite3_free(p->apRegion[i]);
    }
    }

    4. take out mmap:

    if( pShmNode->h>=0 ){
    /* djgpp
    pMem = mmap(0, szRegion,
    pShmNode->isReadonly ? PROT_READ : PROT_READ|PROT_WRITE,
    MAP_SHARED, pShmNode->h, szRegion*(i64)pShmNode->nRegion
    );
    */
    if( pMem==MAP_FAILED ){
    rc = unixLogError(SQLITE_IOERR_SHMMAP, "mmap", pShmNode->zFilename);
    goto shmpage_out;
    }

    Then it did compile and seemed to work so far. The library does not use mmap, only the shell program sqlite3.exe does and I guess that will work so far without mmap in DOS.

    Georg


    Where do I place those lines of code?

    Why wasn't mmap implemented in the first place?

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From RayeR@21:1/5 to All on Mon Oct 2 18:38:54 2023
    Why wasn't mmap implemented in the first place?
    Because DPMI 0.9 doesn't support the required functionality, AFAIR.

    CWSDPMI supports some DPMI 1.0 functions. I implemented a subset of mmap for DOS port of NVclock utility via the __djgpp_map_physical_memory()

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)