Subject: Re: wrap up of pipe(2)
To: Greg A. Woods <woods@weird.com>
From: Andrew Brown <atatat@atatdot.net>
List: tech-userlevel
Date: 10/16/2001 13:53:28
>> 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.
>
>Maybe it should do what read(2) and readv(2) do and return with EINVAL
>set when the value to be returned is larger than INT_MAX?

read(2) and write(2) don't do that...what they do is return EINVAL if
asked to read or write more than SSIZE_MAX.  they don't check the
value to be returned.

if they actually did the read or write and *then* failed because there
was too much data, that would be disastrous.

-- 
|-----< "CODE WARRIOR" >-----|
codewarrior@daemon.org             * "ah!  i see you have the internet
twofsonet@graffiti.com (Andrew Brown)                that goes *ping*!"
andrew@crossbar.com       * "information is power -- share the wealth."