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
F131677836: D18949.id53223.diff
Fri, Oct 10, 6:54 AM
F131677834: D18949.id53177.diff
Fri, Oct 10, 6:54 AM
F131677833: D18949.id.diff
Fri, Oct 10, 6:54 AM
F131677825: D18949.id53175.diff
Fri, Oct 10, 6:54 AM
F131648716: D18949.diff
Fri, Oct 10, 1:02 AM
Unknown Object (File)
Sat, Sep 20, 10:27 AM
Unknown Object (File)
Wed, Sep 10, 7:07 PM
Unknown Object (File)
Wed, Sep 10, 5:54 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

Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 22133
Build 21354: arc lint + arc unit

Event Timeline

lib/libc/sys/sendfile.2
107

Why this change?

418

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

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

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.