Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 10 Feb 2005 20:14:53 +0000
From:      Colin Percival <cperciva@freebsd.org>
To:        Colin Percival <cperciva@FreeBSD.org>
Cc:        cvs-all@FreeBSD.org
Subject:   Re: cvs commit: src/lib/libc/sys read.2 write.2
Message-ID:  <420BC0BD.4030105@freebsd.org>
In-Reply-To: <200502102009.j1AK92Nf010692@repoman.freebsd.org>
References:  <200502102009.j1AK92Nf010692@repoman.freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help
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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?420BC0BD.4030105>