EFBIG (File too large)

Lennart Sorensen lsorense-1wCw9BSqJbv44Nm34jS7GywD8/FfD2ys at public.gmane.org
Mon Feb 25 16:27:25 UTC 2008


On Mon, Feb 18, 2008 at 12:19:21AM -0500, D. Hugh Redelmeier wrote:
> I've been using my text editor (JOVE) for roughly 25 years.  I got a 
> surprise today, but I don't know how long this has been lurking.
> 
> I tried to read a log file into the editor but it said 
>   Couldn't open "/space/tmp/logs/mythburn.log".
> 
> I had no idea why.  The permissions were correct.  So I straced the editor 
> and found that the file open syscall failed with EFBIG.
> 
> What the heck is this?
> 
> The open(2) manpage did not list EFBIG.  Bad.
> 
> But I did see this bit:
>        O_LARGEFILE
>               (LFS)  Allow files whose sizes cannot be represented in an off_t
>               (but can be represented in an off64_t) to be opened.
> 
> This seems really stupid.  Why not make off_t large enough to do its
> job?  Why have a separate off64_t?  We use headers and typedefs so
> these things can change when they should.

Backwards compatibility.  Some programs may have stupidly thought they
could use an integer to keep track of things and if you suddenly change
from 32 to 64 bits then you can have the program crash.

> I'm not going to "fix" JOVE.  Why add cruft like that.

Because that's how things work when you don't want to break an existing
API.  This isn't Windows after all.

--
Len Sorensen
--
The Toronto Linux Users Group.      Meetings: http://gtalug.org/
TLUG requests: Linux topics, No HTML, wrap text below 80 columns
How to UNSUBSCRIBE: http://gtalug.org/wiki/Mailing_lists





More information about the Legacy mailing list