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

Date: Wed, 29 Nov 2000 10:13:53 +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: Locking fcntl() and flock() patches
In-Reply-To: <5.0.1.4.0.20001128200658.0347bec0@pop5.banet.net>
Message-ID: <Pine.SUN.3.91.1001129101302.10519A@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 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.

>  >If large regions can be locked, I think we need to consider changing
>  >the declaration of struct flock accordingly.  What trouble can this
>  >make, given that we only widen the types?  Do other systems which
>  >support large files [Linux, Solaris] use different structures in fcntl
>  >locking in this case?
> 
> 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.

>  >> 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.

- Raw text -


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