Mail Archives: djgpp/2000/10/28/03:39:26
> From: falin AT my-deja DOT com
> Newsgroups: comp.os.msdos.djgpp
> Date: Fri, 27 Oct 2000 22:16:59 GMT
>
> Now, I cannot use directly none of the three
> versions with DJGPP. DOS version uses interrupt
> calls, Windows version uses Windows services and
> Linux version uses fcntl() to control file
> locking.
I don't see why can't you use the DOS version. DJGPP supports
interrupt calls, like other DOS-based compilers do. You might need to
change the calls a little bit (see sections 18.1, 18.2, 18.4, and 18.5
in the DJGPP FAQ, for some details), but other than that, you should
be okay.
> My question is if anybody knows if it is possible
> to implement locking services of fcntl() to
> compile this without change with Linux GCC and
> DJGPP.
Yes, this, too, is possible. You need to use the function _dos_lock
to implement the same functionality. Note that on plain DOS (and
Windows 3.1), the file-locking calls need SHARE.EXE to be loaded, or
else they will fail.
> I want not to fight next month with a database
> fail caused by a bad use of file locking.
If your program is going to run on a DOS machine (not on Windows),
there's no much chance some other program could access the same
database at the same time. So a simple band-aid would be to provide
no-op stubs for functions that lock and unlock records in the
database, and avoid the complications of actually messing with DOS
interrupts.
- Raw text -