From owner-freebsd-bugs@FreeBSD.ORG Tue Jun 1 10:00:16 2010 Return-Path: Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 61DEF1065675 for ; Tue, 1 Jun 2010 10:00:16 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (unknown [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id 4F80D8FC2B for ; Tue, 1 Jun 2010 10:00:16 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.4/8.14.4) with ESMTP id o51A0GTP061472 for ; Tue, 1 Jun 2010 10:00:16 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.4/8.14.4/Submit) id o51A0GeR061471; Tue, 1 Jun 2010 10:00:16 GMT (envelope-from gnats) Date: Tue, 1 Jun 2010 10:00:16 GMT Message-Id: <201006011000.o51A0GeR061471@freefall.freebsd.org> To: freebsd-bugs@FreeBSD.org From: =?UTF-8?B?0KXQsNGA0LjRgtC+0L3QvtCyINCV0LLQs9C10L3QuNC5?= Cc: Subject: Re: kern/147226: read(fd, buffer, len) returns -1 immediately, if len >=2147483648 X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: =?UTF-8?B?0KXQsNGA0LjRgtC+0L3QvtCyINCV0LLQs9C10L3QuNC5?= List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 01 Jun 2010 10:00:16 -0000 The following reply was made to PR kern/147226; it has been noted by GNATS. From: =?UTF-8?B?0KXQsNGA0LjRgtC+0L3QvtCyINCV0LLQs9C10L3QuNC5?= To: Bruce Cran Cc: bug-followup@FreeBSD.org Subject: Re: kern/147226: read(fd, buffer, len) returns -1 immediately, if len >=2147483648 Date: Tue, 01 Jun 2010 13:19:46 +0400 To summarize: 1) `man 2 read` on my FreeBSD (64-bit) says that read accepts only len <= INT_MAX (it's my fault that I missed this before creating the issue); 2) `man 2 read` on my Linux system states that up to SSIZE_MAX must be accepted; 3) POSIX states the same as (2). In other words this behavior is correct from FreeBSD's point of view, but FreeBSD does not meet standards here. Did I get it correctly? PS. It sounds pretty strange (at least for me) that 64-bit system cannot read 2Gb at a time. Also, surprisingly read(fd, buff, size_t len) doesn't work with "size_t len" ( which is 8 bytes long ) greater than "INT_MAX" (which is 4 bytes long). Regards, Eugene