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)
Jan 12 2024, 1:15 AM
Unknown Object (File)
Dec 27 2023, 8:23 PM
Unknown Object (File)
Sep 26 2023, 9:51 PM
Unknown Object (File)
Aug 23 2023, 10:14 PM
Unknown Object (File)
Jun 30 2023, 9:51 AM
Unknown Object (File)
Jun 30 2023, 9:51 AM
Unknown Object (File)
Jun 30 2023, 9:49 AM
Unknown Object (File)
Jun 30 2023, 9:49 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

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.