Mail Archives: djgpp-workers/2000/10/23/11:33:23
On Mon, 23 Oct 2000, Peter J. Farley III wrote:
> >Note that, apart of `_dos_lock', there's also `lock', that does
> >similar things.
>
> But "lock" just calls "_dos_lock"
Yup. Seems like my memory betrayed me, I didn't remember that the one
called the other. Sorry for the noise.
> which issues INT 21/AH=5C, which
> requires SHARE in plain DOS, if I'm reading Ralf Brown's list
> correctly.
That's correct, SHARE is required in plain DOS and on Windows 3.x, for
this function to work.
> My reading of Ralf Brown's list may be incorrect here, but I think
> INT21/5C will return an error unless SHARE or some network providing
> the "advisory lock" function is loaded. Am I wrong about that?
You are not wrong. What I was asking was whether you should care about
these failures, in this context. Given that no other application would
be ever able to access the storage on a single-task DOS machine, where's
the problem?
> (Mis-spellings not mine, pasted verbatim.) The functions of this
> extension that fail are "lock_store" and "lock_retrieve", which each
> perform an "flock" before storing or retrieving, respectively.
It strikes me that Perl could ignore the error in locking when it runs on
plain DOS. Windows is another matter; but on Windows VSHARE is always
loaded and does the job.
So I'd suggest to write flock that uses 21/51, and add some ifdef'ed code
to Perl that if flock fails on DOS, to ignore the failure. (If you don't
know how to tell whether you run on Windows, check out Int 2Fh/AX=1600h.)
- Raw text -