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)
Wed, May 22, 4:01 PM
Unknown Object (File)
Wed, May 22, 4:49 AM
Unknown Object (File)
Mon, May 20, 6:33 PM
Unknown Object (File)
Mon, May 20, 10:27 AM
Unknown Object (File)
Mon, May 20, 9:55 AM
Unknown Object (File)
Jan 12 2024, 1:15 AM
Unknown Object (File)
Dec 27 2023, 8:23 PM
Unknown Object (File)
Sep 26 2023, 9:51 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

Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 20452
Build 19887: 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.