Page MenuHomeFreeBSD

Document that `sendfile` will return an invalid value for `sbytes` if provided an invalid address

Authored by ngie on Jan 24 2019, 10:11 PM.



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

Test Plan
make -C lib/libc/ sendfile.2lint
igor lib/libc/sendfile.2

(this fails citing a bogus issue with the AUTHORS section.

Diff Detail

rS FreeBSD src repository
Automatic diff as part of commit; lint not applicable.
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

ngie created this revision.Jan 24 2019, 10:11 PM
glebius added inline comments.Jan 24 2019, 10:33 PM
107 ↗(On Diff #53175)

Why this change?

418 ↗(On Diff #53175)

I'm not native speaker, but my reading of this phrase is ambigous:

sendfile will not return -1 ​and fail with EFAULT ​in that case

May be wording like this would be more clear:

sendfile will not return -1 ​and will not set errno to EFAULT ​in that case


ngie marked an inline comment as done.Jan 24 2019, 10:41 PM
ngie added inline comments.
107 ↗(On Diff #53175)

I will commit this change separately. Basically, I was fixing a linter issue:

$ make -C ~/nfs/svn/freebsd/base/head/lib/libc sendfile.2lint
[Creating objdir /usr/obj/usr/home/ngie/nfs/svn/freebsd/base/head/amd64.amd64/lib/msun...]
mandoc -Tascii -Tlint /usr/home/ngie/nfs/svn/freebsd/base/head/lib/libc/sys/sendfile.2
mandoc: /usr/home/ngie/nfs/svn/freebsd/base/head/lib/libc/sys/sendfile.2:107:2: WARNING: missing -width in -tag list, using 6n: Bl -tag
*** Error code 2

make: stopped in /home/ngie/nfs/svn/freebsd/base/head/lib/libc
418 ↗(On Diff #53175)

You're right -- it was poorly worded. Let me reword it.

ngie updated this revision to Diff 53177.Jan 24 2019, 10:42 PM
ngie marked an inline comment as done.

Reword the BUGS section I added. As @glebius noted, it was really wordy.

glebius accepted this revision.Jan 24 2019, 11:18 PM
This revision is now accepted and ready to land.Jan 24 2019, 11:18 PM
0mp accepted this revision.Jan 25 2019, 10:20 AM
0mp added a subscriber: 0mp.

OK from manpages.

This revision was automatically updated to reflect the committed changes.