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