Date: Mon, 27 Nov 2000 15:15:41 +0200 (IST) From: Eli Zaretskii X-Sender: eliz AT is To: Martin Stromberg 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: 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, 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.