delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp-workers/2000/10/23/11:33:23

Date: Mon, 23 Oct 2000 17:31:52 +0200 (IST)
From: Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>
X-Sender: eliz AT is
To: "Peter J. Farley III" <pjfarley AT banet DOT net>
cc: djgpp-workers AT delorie DOT com
Subject: Re: New versions of perl require "flock" or working "fcntl(fh, F_SETLK/W,...)"
In-Reply-To: <4.3.1.0.20001023101622.00af2d10@pop5.banet.net>
Message-ID: <Pine.SUN.3.91.1001023172313.15701G-100000@is>
MIME-Version: 1.0
Reply-To: djgpp-workers AT delorie DOT com
Errors-To: nobody AT delorie DOT com
X-Mailing-List: djgpp-workers AT delorie DOT com
X-Unsubscribes-To: listserv AT delorie DOT com

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 -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019