delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp-workers/2000/11/29/23:03:52

Message-Id: <5.0.1.4.0.20001129224255.025ab530@pop5.banet.net>
X-Sender: usbanet DOT farley3 AT pop5 DOT banet DOT net
X-Mailer: QUALCOMM Windows Eudora Version 5.0.1
Date: Wed, 29 Nov 2000 23:04:24 -0500
To: Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>
From: "Peter J. Farley III" <pjfarley AT banet DOT net>
Subject: Re: Locking fcntl() and flock() patches
Cc: djgpp-workers AT delorie DOT com
In-Reply-To: <Pine.SUN.3.91.1001129101302.10519A@is>
References: <5 DOT 0 DOT 1 DOT 4 DOT 0 DOT 20001128200658 DOT 0347bec0 AT pop5 DOT banet DOT net>
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

At 10:13 AM 11/29/00 +0200, Eli Zaretskii wrote:
 >On Tue, 28 Nov 2000, Peter J. Farley III wrote:
 >
 >> Ah!  I misunderstood.  Then, how about just the part of the comment 

 >> that the value for 21h/33 was changed from EPERM to EACCES for
 >> fcntl?  Is that more appropriate?
 >
 >That's exactly what I had in mind.

OK, will do.

<Snipped>
 >> Well, I think on systems that support large files, type "off_t" is
 >> probably a "long long", whatever that means on those systems.
 >
 >No, I don't think so.  Changing off_t to long long would break lots 
of
 >existing code which assumes off_t and ssize_t are compatible.

Well, if that's the case then I don't know what else to say.  Obviously 
we *can* widen them, but I don't have the expertise to say if we 
*should* do so.  What we need here is someone with experience on a 
system that actually has the capability.

 >>>> How would one go about determining whether an arbitrary
 >>>> combination "covered the whole file"?
 >>>
 >>> You use lseek to seek to the starting offset, then look at lseek's
 >>> return value and compare it with zero.  Then you lseek to the end
 >>> of the region and compare lseek's return value with the result of
 >>> "lseek(fd,0,SEEK_END);".
 >>
 >> I also assume you meant to say "llseek" there, right?
 >
 >Yes.

Thanks for the confirmation.  Well, If we are going to allow F_RDLCK's 
that cover the whole file, I guess that's not too much code to add.  I 
won't add it until we determine whether we should do them at 
all.  (Please see my other reply on this).

---------------------------------------------------------
Peter J. Farley III (pjfarley AT dorsai DOT org OR
                      pjfarley AT banet DOT net)

- Raw text -


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