-
Notifications
You must be signed in to change notification settings - Fork 674
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Making signal API real-time signal aware #2451
base: master
Are you sure you want to change the base?
Making signal API real-time signal aware #2451
Conversation
I've managed to work out most issues with tests, but I don't know why these three are failing, and why they are failing on mips and pass on everything else. I think I'll have to set up a VM emulating a mips CPU to solve it. |
Hi, thanks for the PR! I will take a deeper look at how to add realtime signal support and this PR this weekend |
I've run into a problem while setting up the MIPS virtual machine -- almost none of the mainstream Linux distrubutions support MIPS anymore. Also, the targets for which these tests are failing are not available in P.S. If you can advise where a MIPS virtual machine images can be downloaded (with Rust compiler), I can try to work these issues out. |
This is because they are in tier 3.
In Nix's platform support, they are in tier 1, so we cannot drop them. QEMU can have problems, so if there are really weird, just ignore the tests under QEMU About this PR, generally it looks good, I just haven't made a thought about the interface design as this will be a breaking change. I want to make a thorough thought before taking any further actions, sorry about this. |
I'd like to ask, where can I download the QEMU virtual machine image for MIPS with Rust to work these issues out? |
Thank you! I've installed a test environment using |
…nstead of leaping to SIGRTMIN
I've managed to figure out the exact problem with the mips tests:
|
Currently, the
nix::sys::signal::sigaction()
function uses theSignal
enum, which only covers standard signals, but not real-time signals. Using real-time signals withnix
requires using thestd::mem::transmute()
function to assign an impossible value to theSignal
enum, which is undefined behavior (and is unsafe for any other use than passing tonix
functions, and possible even then).What does this PR do
In this PR, the
nix::sys::signal
API is made real-time signal aware by adding the new enumSignalValue
that has two variants:Standard
that takesSignal
values, andRealtime
, that takes real-time signal numbersSIGRTMIN+n
, wheren
is the passed number. Most of the functions are left untouched, instead, real-time signal aware versions of the were added with thert_
prefix (similar to the real-time signal aware system calls in the Linux kernel that glibc uses instead of the old system calls). However, two significant changes have been made: turningSigSet
into iterator returns aSignalSetIter
instead of real-time signal unawareSigSetIter
, and thesignal
field of structsSigevSignal
andSigevThreadId
takes the new enum instead of the old one.Checklist:
CONTRIBUTING.md