1 #include <signal.h> 2 #include <errno.h> 3 #include "syscall.h" 4 #include <unsupported_api.h> 5 sigaltstack(const stack_t * restrict ss,stack_t * restrict old)6int sigaltstack(const stack_t *restrict ss, stack_t *restrict old) 7 { 8 UNSUPPORTED_API_VOID(LITEOS_A); 9 if (ss) { 10 if (!(ss->ss_flags & SS_DISABLE) && ss->ss_size < MINSIGSTKSZ) { 11 errno = ENOMEM; 12 return -1; 13 } 14 if (ss->ss_flags & SS_ONSTACK) { 15 errno = EINVAL; 16 return -1; 17 } 18 } 19 return syscall(SYS_sigaltstack, ss, old); 20 } 21