-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Creating proper type for sighandler_t using anonymous union on Unix #2107
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
Open
landhb
wants to merge
8
commits into
rust-lang:main
Choose a base branch
from
landhb:sigaction
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
c0cc9e8
creating anonymous union for sighandler_t on unix
landhb 6ead37b
ensure the void pointer is a mutable pointer
landhb 0ea39ba
conforming line width to style guidelines
landhb ab1060b
anonymous union should be prepended by double underscore
landhb ff56368
impl extra_traits for __c_anonymous_sigaction_handler, style fixes
landhb 101789b
Skipping __c_anonymous for Apple targets, adding new line for rustfmt
landhb 6913b31
moving trait impls before constants
landhb 95a4478
Merge branch 'master' into sigaction
landhb File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is the current type wrong on all the UNIX platforms?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe so. Here's what I can dig up so far:
BSD/XNU uses one of the function pointer variants
void (*sig_t)(int)
, and calls itsig_t
:https://github.com/apple/darwin-xnu/blob/main/bsd/sys/signal.h#L500
https://github.com/NetBSD/src/blob/trunk/sys/sys/signal.h#L172
Haiku has both function pointer variants:
https://github.com/haiku/haiku/blob/d0e006f5569f24e73a4d83f5c9766f1132160d7a/headers/posix/signal.h#L61-L62
Hermit has the
void (*signal_handler_t)(int)
:https://github.com/hermitcore/libhermit/blob/63e67e1af1e56fbb51f14c89997bbaac11a37cfa/include/hermit/signal.h#L46
Redox as well:
https://github.com/redox-os/relibc/blob/29e2f2923170a7a52c5645ab002564bfa4b0c43b/src/header/signal/mod.rs#L35