Fix description of 'offset' argument to explain the case

where 'offset' is NULL.
This commit is contained in:
Michael Kerrisk 2006-07-10 15:48:17 +00:00
parent 4733f53c8c
commit db04da1f6e
1 changed files with 12 additions and 5 deletions

View File

@ -56,9 +56,10 @@ should be a file descriptor opened for reading and
.I out_fd .I out_fd
should be a descriptor opened for writing. should be a descriptor opened for writing.
If
.I offset .I offset
is a pointer to a variable holding the file offset from is not NULL, then it points
which to a variable holding the file offset from which
.BR sendfile () .BR sendfile ()
will start reading data from will start reading data from
.IR in_fd . .IR in_fd .
@ -66,8 +67,14 @@ When
.BR sendfile () .BR sendfile ()
returns, this variable returns, this variable
will be set to the offset of the byte following the last byte that was read. will be set to the offset of the byte following the last byte that was read.
If
.I offset
is not NULL, then
.BR sendfile () .BR sendfile ()
does not modify the current file offset of does not modify the current file offset of
.IR in_fd ;
otherwise the current file offset is adjusted to reflect
the number of bytes read from
.IR in_fd . .IR in_fd .
.I count .I count
@ -142,10 +149,10 @@ Insufficient memory to read from
is a new feature in Linux 2.2. is a new feature in Linux 2.2.
The include file <sys/sendfile.h> is present since glibc2.1. The include file <sys/sendfile.h> is present since glibc2.1.
Other Unixes implement Other Unix systems implement
.BR sendfile () .BR sendfile ()
with different semantics and prototypes. It should with different semantics and prototypes.
not be used in portable programs. It should not be used in portable programs.
.SH "SEE ALSO" .SH "SEE ALSO"
.BR open (2), .BR open (2),
.BR mmap (2), .BR mmap (2),