Page MenuHomeFreeBSD

Rework Linux ppoll system call.
ClosedPublic

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

Details

Summary

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

ltp

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

Looks reasonable

sys/compat/linux/linux.c
685–688

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.Mon, Jun 21, 4:30 PM
This revision was automatically updated to reflect the committed changes.