-
Notifications
You must be signed in to change notification settings - Fork 15.2k
[libc][signal] clean up usage of sighandler_t #125745
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
Changes from 6 commits
62e8a9c
c84b8f2
669bb96
19e518a
d486708
5864bf7
3730708
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -25,6 +25,4 @@ struct sigaction { | |
| #endif | ||
| }; | ||
|
|
||
| typedef void (*__sighandler_t)(int); | ||
|
|
||
| #endif // LLVM_LIBC_TYPES_STRUCT_SIGACTION_H | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -8,14 +8,17 @@ | |
|
|
||
| #include "src/signal/signal.h" | ||
| #include "hdr/signal_macros.h" | ||
| #include "hdr/types/sighandler_t.h" | ||
| #include "src/__support/common.h" | ||
| #include "src/__support/macros/config.h" | ||
| #include "src/signal/sigaction.h" | ||
|
|
||
| namespace LIBC_NAMESPACE_DECL { | ||
|
|
||
| LLVM_LIBC_FUNCTION(sighandler_t, signal, (int signum, sighandler_t handler)) { | ||
| // Our LLVM_LIBC_FUNCTION macro doesn't handle function pointer return types. | ||
| using signal_handler = void (*)(int); | ||
|
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. perhaps
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. hmm...no nevermind. We'd only be able to do
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Perhaps
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ah, no, I get an error related to overload resolution. Ok will leave for now. |
||
|
|
||
| LLVM_LIBC_FUNCTION(signal_handler, signal, | ||
| (int signum, signal_handler handler)) { | ||
| struct sigaction action, old; | ||
| action.sa_handler = handler; | ||
| action.sa_flags = SA_RESTART; | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.