Page MenuHomeFreeBSD

kern_poll: Restore explanatory comment removed in r177374
ClosedPublic

Authored by cem on Oct 23 2018, 5:44 PM.
Tags
None
Referenced Files
Unknown Object (File)
Sun, Dec 1, 12:51 AM
Unknown Object (File)
Tue, Nov 26, 4:35 PM
Unknown Object (File)
Nov 21 2024, 4:29 AM
Unknown Object (File)
Oct 25 2024, 12:42 PM
Unknown Object (File)
Oct 2 2024, 8:00 PM
Unknown Object (File)
Oct 2 2024, 7:32 PM
Unknown Object (File)
Sep 29 2024, 12:49 AM
Unknown Object (File)
Sep 17 2024, 6:08 PM
Subscribers

Details

Summary

The comment isn't stale. The check is bogus in the sense that poll(2)
does not require pollfd entries to be unique in fd space, so there is no
reason there cannot be more pollfd entries than open or even allowed
fds. The check is mostly a seatbelt against accidental misuse or
abuse. FD_SETSIZE, while usually unrelated to poll, is used as an
arbitrary floor for systems with very low kern.maxfilesperproc.

No functional change.

Additionally, document this possible EINVAL condition in the poll.2
manual.

Diff Detail

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

Event Timeline

markj added inline comments.
lib/libc/sys/poll.2
242 ↗(On Diff #49521)

s/and/or/?

Why not just, "exceeds the system tunable .Va kern.maxfilesperproc or .Dv FD_SETSIZE."?

This revision is now accepted and ready to land.Oct 24 2018, 2:49 PM
cem marked an inline comment as done.Oct 24 2018, 7:24 PM
cem added inline comments.
lib/libc/sys/poll.2
242 ↗(On Diff #49521)

The condition is 'and', not or. I'm not sure of the best way to phrase it. I think maxfilesperproc is sort of the primary seatbelt and FD_SETSIZE is a sanity check that maxfilespreproc isn't set super low. I'd be ok reducing it to the simpler sentence: "exceeds the system ... and FD_SETSIZE" if that reads better to you.

lib/libc/sys/poll.2
242 ↗(On Diff #49521)

Oops, I see. I do prefer the simpler version that you suggested.

Simplify poll.2 sentence as discussed

This revision now requires review to proceed.Oct 26 2018, 8:11 PM
cem marked 2 inline comments as done.Oct 26 2018, 8:11 PM
markj added inline comments.
lib/libc/sys/poll.2
243 ↗(On Diff #49662)

Stray )

This revision is now accepted and ready to land.Oct 29 2018, 4:07 PM
cem marked an inline comment as done.Oct 29 2018, 5:11 PM
cem added inline comments.
lib/libc/sys/poll.2
243 ↗(On Diff #49662)

Ah, thanks for catching that. Will fix

This revision was automatically updated to reflect the committed changes.