Page MenuHomeFreeBSD

Split kern_poll() on two counterparts.
ClosedPublic

Authored by dchagin on Tue, Jun 8, 6:35 AM.

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
R10 FreeBSD src repository
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; 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
1572

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
1421

I do not see much sense in the second sentence.

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