Date: Fri, 2 Apr 2010 22:05:38 +0300 From: Kostik Belousov <kostikbel@gmail.com> To: Artem Belevich <fbsdlist@src.cx> Cc: FreeBSD Hackers <freebsd-hackers@freebsd.org> Subject: Re: write(2) size is limited by INT_MAX on amd64 -- is it a bug or a feature? Message-ID: <20100402190538.GM2415@deviant.kiev.zoral.com.ua> In-Reply-To: <v2qed91d4a81004021153ka44d4bc8k5483145ba887f587@mail.gmail.com> References: <v2qed91d4a81004021153ka44d4bc8k5483145ba887f587@mail.gmail.com>
next in thread | previous in thread | raw e-mail | index | archive | help
--IHQEUyCPif9NwElJ Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Apr 02, 2010 at 11:53:09AM -0700, Artem Belevich wrote: > Hi, >=20 > I've ran into a problem on 8-stable/amd64 today. Basically any attempt > to pass 2GB chunk of data to write(2) returns EINVAL. It looks like > we're limiting amount of data to be written to INT_MAX which looks > rather restrictive on LP64 platforms. NetBSD/OpenBSD do use SSIZE_MAX > which does seem to be the limit specified by POSIX, if I'm looking at > the correct specification here > http://www.opengroup.org/onlinepubs/000095399/functions/write.html >=20 > A bit of googling shows that this issue was also recently mentioned on > svn-src-all: > http://www.mail-archive.com/svn-src-all@freebsd.org/msg18266.html >=20 > Was the INT_MAX limit in FreeBSD imposed intentionally, even on 64-bit > platforms or is it a bug that needs fixing? I did some preliminary work for this, changing the type of uio_resid member of struct uio in stable/8 and HEAD to ssize_t. I have half-finished patch that takes this to completion, allowing SSIZE_MAX maximal i/o. No ETA when it will be done. --IHQEUyCPif9NwElJ Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.10 (FreeBSD) iEYEARECAAYFAku2QAEACgkQC3+MBN1Mb4iFHACfXrTaFxCKh+uX+lBHSYlcaB6B tK0An3T/GHIBwzA6QLmu6mByoSjRyZG/ =15Ld -----END PGP SIGNATURE----- --IHQEUyCPif9NwElJ--
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20100402190538.GM2415>