Subject: Re: wrap up of pipe(2)
To: Matthias Buelow <email@example.com>
From: Andreas Persson <firstname.lastname@example.org>
Date: 10/15/2001 16:37:25
On Mon, Oct 15, 2001 at 12:26:15AM +0200, Matthias Buelow <email@example.com> wrote:
>This would be (theoretically) problematic with long == 8 byte anyways,
>since long is signed, thus skipping the upper part of the address space;
>you cannot change this, since read has to be able to return a negative
>value. It might be argued that reading >> 2**63 bytes is virtually
>impossible, and then again, when was the last time you encountered a
>program which tried to slurp in 2 gig (2**31) using read(2)?
>So this "problem" is probably faster to show up with the 31-bit limit
>of type "int" (== ssize_t on the current implementation) on any
>architecture, since 2 gig memory sizes, files, and time to read it is
>a lot more feasable than >> 2**63 would ever be, although there are
>probably more pressing problems than that one :).
A more pressing problem in my opinion is that some ioctls return int,
when they should be returning off_t, or perhaps size_t. Look at FIONREAD,
for example. If used on a vnode and a system with 32 bit ints, it will
simply truncate the file size.