Date: Fri, 01 Dec 2000 09:50:42 +0200 From: "Eli Zaretskii" Sender: halo1 AT zahav DOT net DOT il To: pjfarley AT banet DOT net Message-Id: <2427-Fri01Dec2000095041+0200-eliz@is.elta.co.il> X-Mailer: Emacs 20.6 (via feedmail 8.3.emacs20_6 I) and Blat ver 1.8.6 CC: djgpp-workers AT delorie DOT com, snowball3 AT bigfoot DOT com In-reply-to: <5.0.1.4.0.20001130214616.025cb150@pop5.banet.net> (pjfarley AT banet DOT net) Subject: Re: Locking fcntl() and flock() patches References: <3A261A2D DOT 6814 DOT 24A3A8 AT localhost> <5 DOT 0 DOT 1 DOT 4 DOT 0 DOT 20001130214616 DOT 025cb150 AT pop5 DOT banet DOT net> 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 > Date: Thu, 30 Nov 2000 21:56:19 -0500 > From: "Peter J. Farley III" > > At 09:27 AM 11/30/00 -0500, Mark E. wrote: > >> Does the IOCTL subfunction or poking the SFT allow to set the > >> SH_DENY* bits for files that are already open? > > >You can fiddle with those flags in the SFT, but I haven't > experimented >with them. > > OK, you folk are beyond my level of knowledge here. Are you saying > there is an alternate way to set up read locks? Yes, you can implement a sort of shared locks on the entire file by setting the sharing bits of the handle. > Assuming that these bits can be set on an open file, how would it > work? The idea is to set the relevant bit(s) with either Int 21h/AX=4401h or by directly poking the SFT. Then Windows' VSHARE will refuse other processes/handles access to the file. However, I don't think this is worth your hassle to implement this now. Poking the SFT is not reliable enough, and doesn't allow to lock parts of a file. So I think leaving a FIXME comment about this possibility in the sources, and treating shared locks as write locks would be enough at this time.