-
Notifications
You must be signed in to change notification settings - Fork 7.4k
posix: add stubs for signal.h functions that need process support #74436
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 all commits
85b29a5
0f00efa
9616c43
4bd5b2c
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -77,6 +77,16 @@ typedef struct { | |
#define SIG_UNBLOCK 2 | ||
#endif | ||
|
||
#define SIG_DFL ((void *)0) | ||
#define SIG_IGN ((void *)1) | ||
#define SIG_ERR ((void *)-1) | ||
|
||
#define SI_USER 1 | ||
#define SI_QUEUE 2 | ||
#define SI_TIMER 3 | ||
#define SI_ASYNCIO 4 | ||
#define SI_MESGQ 5 | ||
|
||
typedef int sig_atomic_t; /* Atomic entity type (ANSI) */ | ||
|
||
union sigval { | ||
|
@@ -92,12 +102,34 @@ struct sigevent { | |
int sigev_signo; | ||
}; | ||
|
||
typedef struct { | ||
int si_signo; | ||
int si_code; | ||
union sigval si_value; | ||
} siginfo_t; | ||
|
||
struct sigaction { | ||
void (*sa_handler)(int signno); | ||
sigset_t sa_mask; | ||
int sa_flags; | ||
void (*sa_sigaction)(int signo, siginfo_t *info, void *context); | ||
}; | ||
|
||
unsigned int alarm(unsigned int seconds); | ||
int kill(pid_t pid, int sig); | ||
int pause(void); | ||
int raise(int signo); | ||
int sigaction(int sig, const struct sigaction *ZRESTRICT act, struct sigaction *ZRESTRICT oact); | ||
int sigpending(sigset_t *set); | ||
int sigsuspend(const sigset_t *sigmask); | ||
int sigwait(const sigset_t *ZRESTRICT set, int *ZRESTRICT signo); | ||
char *strsignal(int signum); | ||
int sigemptyset(sigset_t *set); | ||
int sigfillset(sigset_t *set); | ||
int sigaddset(sigset_t *set, int signo); | ||
int sigdelset(sigset_t *set, int signo); | ||
int sigismember(const sigset_t *set, int signo); | ||
void (*signal(int signo, void (*)(int signo)))(int signo); | ||
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. GNU extension is so much clear :)
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. It is convenient, but also a gnu-ism. 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. yep :) 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. I haven't seen any conflicts when using the typedef, even when building using |
||
int sigprocmask(int how, const sigset_t *ZRESTRICT set, sigset_t *ZRESTRICT oset); | ||
|
||
int pthread_sigmask(int how, const sigset_t *ZRESTRICT set, sigset_t *ZRESTRICT oset); | ||
|
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.
Shouldn't it be
to avoid possible hole in the struct.
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.
Fixed!