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)
Sat, Mar 2, 3:46 AM
Unknown Object (File)
Feb 4 2024, 9:48 AM
Unknown Object (File)
Feb 1 2024, 1:50 PM
Unknown Object (File)
Jan 11 2024, 11:01 PM
Unknown Object (File)
Dec 23 2023, 4:17 AM
Unknown Object (File)
Nov 5 2023, 6:17 PM
Unknown Object (File)
Oct 24 2023, 3:07 AM
Unknown Object (File)
Oct 4 2023, 5:14 PM
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.