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
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.Where do I place those lines of code?
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
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:According to Georg's instructions sqlite3.c from the source code.
Well, on a lazy Sunday afternoon I tried to compile SQLite too.Where do I place those lines of code?
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
Frank
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?Because DPMI 0.9 doesn't support the required functionality, AFAIR.
Sysop: | Keyop |
---|---|
Location: | Huddersfield, West Yorkshire, UK |
Users: | 407 |
Nodes: | 16 (2 / 14) |
Uptime: | 17:48:03 |
Calls: | 8,555 |
Calls today: | 7 |
Files: | 13,219 |
Messages: | 5,925,986 |