Page MenuHomeFreeBSD

Split kern_poll() on two counterparts.
ClosedPublic

Authored by dchagin on Jun 8 2021, 6:35 AM.
Tags
None
Referenced Files
F168569079: D30690.id90694.diff
Sat, Aug 29, 1:52 AM
F168568985: D30690.id90596.diff
Sat, Aug 29, 1:51 AM
F168453212: D30690.id90578.diff
Fri, Aug 28, 11:23 AM
F168414723: D30690.id90574.diff
Fri, Aug 28, 4:05 AM
Unknown Object (File)
Thu, Aug 27, 6:33 PM
Unknown Object (File)
Thu, Aug 27, 12:15 PM
Unknown Object (File)
Thu, Aug 27, 12:08 PM
Unknown Object (File)
Thu, Aug 27, 10:30 AM
Subscribers

Details

Summary

The kern_poll() operates on clear kernel data, while the kern_poll_ufds()
operates on user supplied pollfd.
Move nfds check to kern_poll_maxfds().

No functional changes, it's for future use in the Linux emulation layer.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

make kern_poll private, kern_poll_ufds - public
use kern_poll_ufds in freebsd32, linux

I believe it would be useful to add a comment above each of kern_poll_{u,k}fds, explaining that corresponding function expects from fds pointer.

sys/kern/sys_generic.c
1573

I would make kern_poll_maxfds() returning bool, and then just write

if (!kern_poll_maxfds(nfds))
    return (EINVAL);

I left the previous name for the kern_poll() to not break third-party modules

sys/kern/sys_generic.c
1422

I do not see much sense in the second sentence.

This revision is now accepted and ready to land.Jun 8 2021, 8:11 PM
This revision was automatically updated to reflect the committed changes.