Page MenuHomeFreeBSD

Rework Linux ppoll system call.

Authored by dchagin on Jun 10 2021, 12:23 PM.



For now the Linux emulation layer uses in kernel ppoll(2) without
conversion of user supplied fd 'events', and does not convert the
kernel supplied fd 'revents'.

At least POLLRDHUP is handled by FreeBSD differently than by
Linux. Seems that Linux silencly ignores POLLRDHUP on non socket fd's
unlike FreeBSD, which does more strictly check and fails.

Rework the Linux ppoll, using kern_poll and converting 'events'
and 'revents' values.
While here, move poll events defines to the MI part of code as they
mostly identical on all arches except arm.

Test Plan


Diff Detail

rG FreeBSD src repository
Automatic diff as part of commit; lint not applicable.
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

Looks reasonable


we may need to add some sort of ratelimiting for these (as a followup)?

fix grammar, rate limit diagnostics.

move conversion routines declaration to linux_common.h as
linux.h does not intended for MD things

emaste@, what are you think about using fget_unlocked() in linux_to_bsd_poll_events?

This revision was not accepted when it landed; it landed in state Needs Review.Jun 21 2021, 4:30 PM
This revision was automatically updated to reflect the committed changes.