cvs commit: src/lib/libc/sys read.2 write.2

Colin Percival cperciva at freebsd.org
Thu Feb 10 20:14:55 GMT 2005


Colin Percival wrote:
>   read(), pread(), write(), and pwrite() return EINVAL if they are asked
>   for more than INT_MAX bytes.

According to POSIX, these calls have "implementation-defined behaviour" if
nbytes is more than SSIZE_MAX (but should presumably operate without complaint
on sizes up to that limit).  The offending test is in dofilewrite() and
dofileread() in sys_generic.c, but fixing this might cause problems in lower
layers if there is any 64-bit unclean code lurking.

I don't have enough time at the moment to check for such problems, but if
someone else does, I'm sure someone somewhere would appreciate being able to
read and write more than 2GB at once. :-)

Colin Percival


More information about the cvs-all mailing list