Page MenuHomeFreeBSD

Rework Linux ppoll system call.
ClosedPublic

Authored by dchagin on Jun 10 2021, 12:23 PM.
Tags
None
Referenced Files
Unknown Object (File)
Feb 11 2024, 2:45 AM
Unknown Object (File)
Feb 4 2024, 4:52 PM
Unknown Object (File)
Feb 2 2024, 2:10 PM
Unknown Object (File)
Jan 30 2024, 12:58 AM
Unknown Object (File)
Jan 14 2024, 4:52 AM
Unknown Object (File)
Dec 24 2023, 6:25 PM
Unknown Object (File)
Dec 20 2023, 11:13 PM
Unknown Object (File)
Dec 20 2023, 7:07 AM
Subscribers

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
rS FreeBSD src repository - subversion
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 39861
Build 36750: arc lint + arc unit

Event Timeline

Looks reasonable

sys/compat/linux/linux.c
686–689

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.