Subject: Re: wrap up of pipe(2)
To: NetBSD Userlevel Technical Discussion List <tech-userlevel@NetBSD.ORG>
From: Matthias Buelow <mkb@mukappabeta.de>
List: tech-userlevel
Date: 10/15/2001 00:26:15
Greg A. Woods writes:

>If that's true then it's quite likely NetBSD will run on systems where
>read(2) could return EINVAL because there was more than SSIZE_MAX bytes
>to return....  if not right away then in the near future...  :-)

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 :).

--mkb