From owner-freebsd-hackers@FreeBSD.ORG Fri Apr 2 19:05:45 2010 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8FE9D106566C for ; Fri, 2 Apr 2010 19:05:45 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from mail.zoral.com.ua (mx0.zoral.com.ua [91.193.166.200]) by mx1.freebsd.org (Postfix) with ESMTP id E2F918FC12 for ; Fri, 2 Apr 2010 19:05:44 +0000 (UTC) Received: from deviant.kiev.zoral.com.ua (root@deviant.kiev.zoral.com.ua [10.1.1.148]) by mail.zoral.com.ua (8.14.2/8.14.2) with ESMTP id o32J5caO083563 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Fri, 2 Apr 2010 22:05:38 +0300 (EEST) (envelope-from kostikbel@gmail.com) Received: from deviant.kiev.zoral.com.ua (kostik@localhost [127.0.0.1]) by deviant.kiev.zoral.com.ua (8.14.4/8.14.4) with ESMTP id o32J5cS0026192; Fri, 2 Apr 2010 22:05:38 +0300 (EEST) (envelope-from kostikbel@gmail.com) Received: (from kostik@localhost) by deviant.kiev.zoral.com.ua (8.14.4/8.14.4/Submit) id o32J5cDl026191; Fri, 2 Apr 2010 22:05:38 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: deviant.kiev.zoral.com.ua: kostik set sender to kostikbel@gmail.com using -f Date: Fri, 2 Apr 2010 22:05:38 +0300 From: Kostik Belousov To: Artem Belevich Message-ID: <20100402190538.GM2415@deviant.kiev.zoral.com.ua> References: Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="IHQEUyCPif9NwElJ" Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.4.2.3i X-Virus-Scanned: clamav-milter 0.95.2 at skuns.kiev.zoral.com.ua X-Virus-Status: Clean X-Spam-Status: No, score=-3.8 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00, DNS_FROM_OPENWHOIS autolearn=no version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on skuns.kiev.zoral.com.ua Cc: FreeBSD Hackers Subject: Re: write(2) size is limited by INT_MAX on amd64 -- is it a bug or a feature? X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 Apr 2010 19:05:45 -0000 --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--