mirror of
https://github.com/fluencelabs/musl
synced 2025-06-25 12:42:02 +00:00
to deal with the fact that the public headers may be used with pre-c99 compilers, __restrict is used in place of restrict, and defined appropriately for any supported compiler. we also avoid the form [restrict] since older versions of gcc rejected it due to a bug in the original c99 standard, and instead use the form *restrict.
19 lines
334 B
C
19 lines
334 B
C
#include <signal.h>
|
|
#include <errno.h>
|
|
#include "syscall.h"
|
|
|
|
int sigaltstack(const stack_t *restrict ss, stack_t *restrict old)
|
|
{
|
|
if (ss) {
|
|
if (ss->ss_size < MINSIGSTKSZ) {
|
|
errno = ENOMEM;
|
|
return -1;
|
|
}
|
|
if (ss->ss_flags & ~SS_DISABLE) {
|
|
errno = EINVAL;
|
|
return -1;
|
|
}
|
|
}
|
|
return syscall(SYS_sigaltstack, ss, old);
|
|
}
|