summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarcel Telka <marcel@telka.sk>2018-07-19 14:33:28 +0200
committerDan McDonald <danmcd@joyent.com>2018-07-20 11:46:02 -0400
commitd3811b6fb7218c4fd6a4ecc171217022e137b5dc (patch)
tree6003159f037035b012937a597030bc48ee1640f1
parent614f1d633e921143ad22010eeec64ed7c6aa627c (diff)
downloadillumos-joyent-d3811b6fb7218c4fd6a4ecc171217022e137b5dc.tar.gz
9657 sendfile(3ext): off and EINVAL are not documented properly
Reviewed by: Robert Mustacchi <rm@joyent.com> Reviewed by: Sebastian Wiedenroth <wiedi@frubar.net> Approved by: Dan McDonald <danmcd@joyent.com>
-rw-r--r--usr/src/man/man3ext/sendfile.3ext10
1 files changed, 8 insertions, 2 deletions
diff --git a/usr/src/man/man3ext/sendfile.3ext b/usr/src/man/man3ext/sendfile.3ext
index ade1b0dfeb..38f974987e 100644
--- a/usr/src/man/man3ext/sendfile.3ext
+++ b/usr/src/man/man3ext/sendfile.3ext
@@ -3,7 +3,7 @@
.\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License"). You may not use this file except in compliance with the License.
.\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing. See the License for the specific language governing permissions and limitations under the License.
.\" When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE. If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
-.TH SENDFILE 3EXT "Nov 3, 2017"
+.TH SENDFILE 3EXT "Jul 19, 2018"
.SH NAME
sendfile \- send files over sockets or copy files to files
.SH SYNOPSIS
@@ -38,7 +38,11 @@ The \fBsendfile()\fR function can also be used to send buffers by pointing
Upon successful completion, \fBsendfile()\fR returns the total number of bytes
written to \fIout_fd\fR and also updates the offset to point to the byte that
follows the last byte read. Otherwise, it returns \fB-1\fR, and \fBerrno\fR is
-set to indicate the error.
+set to indicate the error. In some error cases \fBsendfile()\fR may still
+write some data before encountering an error and returning \fB-1\fR. When that
+occurs, \fIoff\fR is updated to point to the byte that follows the last byte
+copied and should be compared with its value before calling \fBsendfile()\fR to
+determine how much data was sent.
.SH ERRORS
.LP
The \fBsendfile()\fR function will fail if:
@@ -83,6 +87,8 @@ reading.
.RS 16n
The offset cannot be represented by the \fBoff_t\fR structure, or the length is
negative when cast to \fBssize_t\fR.
+.sp
+Fewer bytes were transferred than were requested.
.RE
.sp