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)
Thu, Nov 21, 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
Unknown Object (File)
Sep 8 2024, 8:48 AM
Unknown Object (File)
Sep 8 2024, 3:55 AM
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

Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 20365
Build 19806: arc lint + arc unit

Event Timeline

markj added inline comments.
lib/libc/sys/poll.2
242

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

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

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

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

Ah, thanks for catching that. Will fix

This revision was automatically updated to reflect the committed changes.