Mail Archives: djgpp-workers/2000/10/23/20:14:02
At 05:31 PM 10/23/00 +0200, you wrote:
<Snipped
>> 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.
No problem. Been there, done that. ;)
>> 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.
Good, then I'm not as complete an illiterate as I thought I might be.
:)
>> 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?
Good point. In that context, perl should not care one way or the
other.
>> (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.)
OK, let me restate what I need to do so I don't get it wrong:
1. Implement flock and fcntl(... F_SETLK/W, ...) using _dos_lock
(INT21/5C) as a base function
2. Add flock to the libc headers (where? unistd.h?)
3. Add a DJGPP wrappper function for perl to call as flock; this is
needed so that the perl flock implementation can ignore errors
when running under plain DOS (using INT 2Fh/AX=1600h)
Q: Do I need to test for Win3.1, or do *all* win versions load
vshare as you said?
Thanks for your help. I may (no, probably *will*) be returning here
for questions as implementation proceeds.
---------------------------------------------------------
Peter J. Farley III (pjfarley AT dorsai DOT org OR
pjfarley AT banet DOT net)
- Raw text -