From owner-freebsd-hackers@FreeBSD.ORG Fri Apr 2 18:53:10 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 F055F1065679 for ; Fri, 2 Apr 2010 18:53:10 +0000 (UTC) (envelope-from artemb@gmail.com) Received: from mail-iw0-f182.google.com (mail-iw0-f182.google.com [209.85.223.182]) by mx1.freebsd.org (Postfix) with ESMTP id B7FE78FC14 for ; Fri, 2 Apr 2010 18:53:10 +0000 (UTC) Received: by iwn12 with SMTP id 12so668256iwn.14 for ; Fri, 02 Apr 2010 11:53:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:sender:received:date :x-google-sender-auth:received:message-id:subject:from:to :content-type; bh=qSBcb3HnzNs5dpv4W5mpU6rPFKvCw0u0RbWfE74ReS0=; b=CXUxksD6RpQ9Zh5rHDKPdROEqAcyFcCNV+iPrwcgkdnrqodj+yF11+nDH0ZVCWvXUD gvV5hd6fp+SF9pfSSddhuYjnrgd65W05F63lYXfhFLdsmAp5qNOIzLpnbA4q5vO3vceo /DFoa/urxHp7YI+ldzHr2lsF0cMdIQGDnFPq0= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:date:x-google-sender-auth:message-id:subject :from:to:content-type; b=j6vIZIlpwUNeeG3KXuUIvVik+yHCYelTBFcme/4WdbOa5py8ilI+XpSvwy5dsO10SQ YyvISkG2y9kJiBRpGtzgqB9lTjmuaKOqEgQvMWuumFp4W67KCcgokSC9maOoJMy/c7oC AeLGYjTOVA5XW9MOSHXs47vFjQqQIvb9KBLxQ= MIME-Version: 1.0 Sender: artemb@gmail.com Received: by 10.231.35.129 with HTTP; Fri, 2 Apr 2010 11:53:09 -0700 (PDT) Date: Fri, 2 Apr 2010 11:53:09 -0700 X-Google-Sender-Auth: 79d8f8b2eab09a5d Received: by 10.231.190.137 with SMTP id di9mr992525ibb.76.1270234389698; Fri, 02 Apr 2010 11:53:09 -0700 (PDT) Message-ID: From: Artem Belevich To: FreeBSD Hackers Content-Type: text/plain; charset=ISO-8859-1 Subject: 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 18:53:11 -0000 Hi, 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 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 Was the INT_MAX limit in FreeBSD imposed intentionally, even on 64-bit platforms or is it a bug that needs fixing? Thanks, --Artem