-
Notifications
You must be signed in to change notification settings - Fork 6.8k
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
posix: add stubs for signal.h functions that need process support #74436
Conversation
a38404d
to
2baac4a
Compare
2baac4a
to
37370cf
Compare
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 comment
The reason will be displayed to describe this comment to others. Learn more.
GNU extension is so much clear :)
typedef void (*sighandler_t)(int);
sighandler_t signal(int signum, sighandler_t handler);
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.
It is convenient, but also a gnu-ism.
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.
yep :)
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 haven't seen any conflicts when using the typedef, even when building using native_sim
, so I'll add it as well.
sigset_t sa_mask; | ||
int sa_flags; | ||
void (*sa_sigaction)(int signo, siginfo_t *info, void *context); | ||
}; |
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
struct sigaction {
void (*sa_handler)(int signno);
void (*sa_sigaction)(int signo, siginfo_t *info, void *context);
sigset_t sa_mask;
int sa_flags;
};
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!
Adding a temporary DNM until all comments have been addressed. |
37370cf
to
2fe2dcd
Compare
|
Newlib requires an alias for the getpid() function. There was a Kconfig already present for doing so, but the actual alias was missing. So this is technically a bugfix. Signed-off-by: Chris Friedt <[email protected]>
Since Zephyr itself does not currently support processes, but conformant applications should still be able to link, add stubs for the remaining POSIX functions in the POSIX_SIGNALS Option Group. The POSIX_SIGNALS Option Group is required for PSE51, PSE52, PSE53, PSE54, and likely many other POSIX Subprofiles. Signed-off-by: Chris Friedt <[email protected]>
Add tests for the presence of items in the POSIX SIGNALS Option Group. Signed-off-by: Chris Friedt <[email protected]>
2fe2dcd
to
e511bdd
Compare
Please add a refresh +1 @ycsin @vaishnavachath |
Mark the POSIX_SIGNALS Option Group as supported to the extent possible under Zephyr, as Zephyr does not yet support processes. Signed-off-by: Chris Friedt <[email protected]>
e511bdd
to
4bd5b2c
Compare
Since Zephyr itself does not currently support processes, but conformant applications should still be able to link, add stubs for the remaining POSIX functions in the
POSIX_SIGNALS
Option Group.The
POSIX_SIGNALS
Option Group is required for PSE51, PSE52, PSE53, PSE54, and likely many other POSIX Subprofiles.Note
There is a Coding Guidelines false positive about declaring the
raise()
function (from C89).Doc Preview
Fixes #59925
Fixes #59933
Fixes #66923
Fixes #66924
Fixes #66925
Fixes #66929
Fixes #66930