Page MenuHomeFreeBSD

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

Authored by ngie on Jan 24 2019, 10:11 PM.
Tags
None
Referenced Files
Unknown Object (File)
Tue, Dec 17, 3:13 AM
Unknown Object (File)
Sat, Dec 14, 6:08 PM
Unknown Object (File)
Thu, Dec 12, 7:31 PM
Unknown Object (File)
Tue, Dec 10, 11:01 PM
Unknown Object (File)
Thu, Nov 28, 7:08 AM
Unknown Object (File)
Wed, Nov 27, 11:24 PM
Unknown Object (File)
Sun, Nov 24, 1:11 PM
Unknown Object (File)
Nov 12 2024, 1:55 AM
Subscribers

Details

Summary

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

Repository
rS FreeBSD src repository - subversion
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

lib/libc/sys/sendfile.2
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 added inline comments.
lib/libc/sys/sendfile.2
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

Stop.
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 marked an inline comment as done.

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

This revision is now accepted and ready to land.Jan 24 2019, 11:18 PM
0mp added a subscriber: 0mp.

OK from manpages.

This revision was automatically updated to reflect the committed changes.