Date: Mon, 23 Oct 2000 17:31:52 +0200 (IST) From: Eli Zaretskii X-Sender: eliz AT is To: "Peter J. Farley III" 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: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII 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 Precedence: bulk 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.)