From 18777d00085732d47f00bf61b3dbee1cc62d7fbb Mon Sep 17 00:00:00 2001 From: ngie Date: Tue, 12 Feb 2019 02:57:34 +0000 Subject: [PATCH] MFC r339343,r343444: r339343 (by allanjude): Document that sendfile(2) can return ENOTCAPABLE PR: 232207 r343444: Document that `sendfile` will return an invalid value for `sbytes` if provided an invalid address This is meant to clarify the fact that the system call will not fail with -1/EFAULT, as one might expect, when reading the sendfile(2) manpage today. While here, pet the mandoc linter, when dealing with the section that describes valid values for `flags`. PR: 232210 Approved by: jtl (mentor) Differential Revision: https://reviews.freebsd.org/D19150 --- lib/libc/sys/sendfile.2 | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/lib/libc/sys/sendfile.2 b/lib/libc/sys/sendfile.2 index 9d5499cbf76..2119c4253d9 100644 --- a/lib/libc/sys/sendfile.2 +++ b/lib/libc/sys/sendfile.2 @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd January 7, 2016 +.Dd January 25, 2019 .Dt SENDFILE 2 .Os .Sh NAME @@ -104,7 +104,7 @@ variable pointed to by The least significant 16 bits of .Fa flags argument is a bitmap of these values: -.Bl -tag -offset indent +.Bl -tag -offset indent -width "SF_USER_READAHEAD" .It Dv SF_NODISKIO This flag causes .Nm @@ -314,6 +314,12 @@ is negative. .It Bq Er EIO An error occurred while reading from .Fa fd . +.It Bq Er ENOTCAPABLE +The +.Fa fd +or the +.Fa s +argument has insufficient rights. .It Bq Er ENOBUFS The system was unable to allocate an internal buffer. .It Bq Er ENOTCONN @@ -375,3 +381,14 @@ The .Fx 11 implementation was written by .An Gleb Smirnoff Aq Mt glebius@FreeBSD.org . +.Sh BUGS +The +.Fn sendfile +system call will not fail, i.e., return +.Dv -1 +and set +.Va errno +to +.Er EFAULT , +if provided an invalid address for +.Fa sbytes . -- 2.45.0