delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp-workers/1999/01/31/14:59:31

Sender: nate AT cartsys DOT com
Message-ID: <36B4B676.504C69C8@cartsys.com>
Date: Sun, 31 Jan 1999 12:00:54 -0800
From: Nate Eldredge <nate AT cartsys DOT com>
X-Mailer: Mozilla 4.08 [en] (X11; I; Linux 2.0.36 i586)
MIME-Version: 1.0
To: djgpp-workers AT delorie DOT com
CC: Martin Str|mberg <ams AT ludd DOT luth DOT se>
Subject: Re: tell() and 2^31 file sizes
References: <Pine DOT SUN DOT 3 DOT 91 DOT 990131160546 DOT 19083B-100000 AT is>
Reply-To: djgpp-workers AT delorie DOT com

Eli Zaretskii wrote:
> 
> On Sun, 31 Jan 1999, Martin Str|mberg wrote:
> 
> > What should tell() and friends return when the file pointer is beyond
> > 2^31? -1? And set errno to what?
> 
> I think it should return -1 and set errno to ENOSYS.
> 
> > Do we need a _ltell() or _lltell()?
> 
> I don't know.  Do Linux and Solaris have something like that?

I think `tell' is a DOS-ism.  I can't find any reference to it in Linux
(it's not in libc.so, nor is it a system call).  The file position is
fetched by lseek(fd, 0, SEEK_CUR) (or `_llseek' as the case may be), and
that's how `ftell' et al handle it.  So there's no precedent established
there.
-- 

Nate Eldredge
nate AT cartsys DOT com

- Raw text -


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