delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp-workers/2000/11/27/08:17:29

Date: Mon, 27 Nov 2000 15:15:41 +0200 (IST)
From: Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>
X-Sender: eliz AT is
To: Martin Stromberg <eplmst AT lu DOT erisoft DOT se>
cc: djgpp-workers AT delorie DOT com
Subject: Re: Locking fcntl() and flock() patches
In-Reply-To: <200011271215.NAA06726@lws256.lu.erisoft.se>
Message-ID: <Pine.SUN.3.91.1001127151115.17713A-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, 27 Nov 2000, Martin Stromberg wrote:

> > > +      cur_pos = lseek(fd, 0, SEEK_CUR);
> > 
> > This should check if cur_pos is -1, and if so, bail out.  This might
> > happen, e.g., if fd is invalid.
> 
> Not to mention the case of FAT32 and overflowing the off_t type. I
> suggest you use offset_t and llseek().

Right, thanks for catching this.  Yes, llseek and offset_t should be used 
instead.

> Is there somewhere we can put such DJGPP developing niceties (Do not
> use lseek() and off_t in libc. Use llseek() and offset_t instead.)?

There's no place AFAIK with guidelines for developers and internals 
gotchas.  How about starting a file (in src/docs/kb/, say) that would 
hold this stuff (and be @include'd by kb.txi)?  We could then just add
these snippets to it as they come up in our discussions.

- Raw text -


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