Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 1 Jun 2010 10:00:16 GMT
From:      =?UTF-8?B?0KXQsNGA0LjRgtC+0L3QvtCyINCV0LLQs9C10L3QuNC5?= <eugene.kharitonov@gmail.com>
To:        freebsd-bugs@FreeBSD.org
Subject:   Re: kern/147226: read(fd, buffer, len) returns -1 immediately, if len &gt;=2147483648
Message-ID:  <201006011000.o51A0GeR061471@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help
The following reply was made to PR kern/147226; it has been noted by GNATS.

From: =?UTF-8?B?0KXQsNGA0LjRgtC+0L3QvtCyINCV0LLQs9C10L3QuNC5?=
 <eugene.kharitonov@gmail.com>
To: Bruce Cran <bruce@cran.org.uk>
Cc: bug-followup@FreeBSD.org
Subject: Re: kern/147226: read(fd, buffer, len) returns -1 immediately,  if
 len &gt;=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
 



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