aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Kerrisk <mtk.manpages@gmail.com>2015-05-11 15:13:56 +0200
committerMichael Kerrisk <mtk.manpages@gmail.com>2015-05-12 07:07:21 +0200
commit77548009f57a74740838bb2b3f4547ececdf0251 (patch)
tree4052fde89c6196aa2a6915df069e437bc2e4fade
parent9a12dd5031ffb76626e0b8d60beee0637e8b5a6c (diff)
downloadman-pages-77548009f57a74740838bb2b3f4547ececdf0251.tar.gz
pread.2, read.2, readv.2, sendfile.2, write.2: Clarify that Linux limits transfers to a maximum of 0x7ffff000 bytes
See https://bugs.debian.org/629994 and https://bugs.debian.org/630029. Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
-rw-r--r--man2/pread.26
-rw-r--r--man2/read.210
-rw-r--r--man2/readv.27
-rw-r--r--man2/sendfile.27
-rw-r--r--man2/write.212
5 files changed, 42 insertions, 0 deletions
diff --git a/man2/pread.2 b/man2/pread.2
index de1e951b3d..c7a7fdd77d 100644
--- a/man2/pread.2
+++ b/man2/pread.2
@@ -85,6 +85,12 @@ and
.BR pwrite ()
returns the number of bytes written.
+Note that is not an error for a successful call to transfer fewer bytes
+than requested (see
+.BR read (2)
+and
+.BR write (2)).
+
On error, \-1 is returned and
.I errno
is set to indicate the cause of the error.
diff --git a/man2/read.2 b/man2/read.2
index 62d7d8b497..c581f72a9c 100644
--- a/man2/read.2
+++ b/man2/read.2
@@ -87,6 +87,8 @@ available right now (maybe because we were close to end-of-file, or
because we are reading from a pipe, or from a terminal), or because
.BR read ()
was interrupted by a signal.
+See also NOTES.
+
On error, \-1 is returned, and
.I errno
is set appropriately.
@@ -178,6 +180,14 @@ or to return the number of bytes already read.
.SH CONFORMING TO
SVr4, 4.3BSD, POSIX.1-2001.
.SH NOTES
+On Linux,
+.BR read ()
+(and similar system calls) will transfer at most
+0x7ffff000 (2,147,479,552) bytes,
+returning the number of bytes actually transferred.
+.\" commit e28cc71572da38a5a12c1cfe4d7032017adccf69
+(This is true on both 32-bit and 64-bit systems.)
+
On NFS filesystems, reading small amounts of data will update the
timestamp only the first time, subsequent calls may not do so.
This is caused
diff --git a/man2/readv.2 b/man2/readv.2
index 3cc0813d48..3cf0c2f76c 100644
--- a/man2/readv.2
+++ b/man2/readv.2
@@ -184,6 +184,13 @@ return the number of bytes read;
and
.BR pwritev ()
return the number of bytes written.
+
+Note that is not an error for a successful call to transfer fewer bytes
+than requested (see
+.BR read (2)
+and
+.BR write (2)).
+
On error, \-1 is returned, and \fIerrno\fP is set appropriately.
.SH ERRORS
The errors are as given for
diff --git a/man2/sendfile.2 b/man2/sendfile.2
index 972564c7c2..ef9ba6ce7a 100644
--- a/man2/sendfile.2
+++ b/man2/sendfile.2
@@ -113,6 +113,7 @@ Note that a successful call to
.BR sendfile ()
may write fewer bytes than requested;
the caller should be prepared to retry the call if there were unsent bytes.
+See also NOTES.
On error, \-1 is returned, and
.I errno
@@ -166,6 +167,12 @@ Other UNIX systems implement
with different semantics and prototypes.
It should not be used in portable programs.
.SH NOTES
+.BR sendfile ()
+will transfer at most 0x7ffff000 (2,147,479,552) bytes,
+returning the number of bytes actually transferred.
+.\" commit e28cc71572da38a5a12c1cfe4d7032017adccf69
+(This is true on both 32-bit and 64-bit systems.)
+
If you plan to use
.BR sendfile ()
for sending files to a TCP socket, but need
diff --git a/man2/write.2 b/man2/write.2
index 90ef9b5994..3e8c363ab9 100644
--- a/man2/write.2
+++ b/man2/write.2
@@ -89,6 +89,10 @@ Note that not all filesystems are POSIX conforming.
.SH RETURN VALUE
On success, the number of bytes written is returned (zero indicates
nothing was written).
+It is not an error if this number is smaller than the number of bytes
+requested; this may happen for example because the disk device was filled.
+See also NOTES.
+
On error, \-1 is returned, and \fIerrno\fP is set
appropriately.
@@ -217,6 +221,14 @@ then the call fails with the error
.BR EINTR ;
if it is interrupted after at least one byte has been written,
the call succeeds, and returns the number of bytes written.
+
+On Linux,
+.BR read ()
+(and similar system calls) will transfer at most
+0x7ffff000 (2,147,479,552) bytes,
+returning the number of bytes actually transferred.
+.\" commit e28cc71572da38a5a12c1cfe4d7032017adccf69
+(This is true on both 32-bit and 64-bit systems.)
.SH BUGS
According to POSIX.1-2008/SUSv4 Section XSI 2.9.7
("Thread Interactions with Regular File Operations"):