1 #include <signal.h> 2 #include "syscall.h" 3 sigsuspend(const sigset_t * mask)4int sigsuspend(const sigset_t *mask) 5 { 6 int ret,retval; 7 sigset_t oldset; 8 9 retval = sigprocmask(SIG_BLOCK, 0, &oldset); 10 if (retval != 0){ 11 return retval; 12 } 13 14 ret = syscall_cp(SYS_rt_sigsuspend, mask, _NSIG/8); 15 16 if (ret == -1){ 17 retval = sigprocmask(SIG_SETMASK, &oldset, 0); 18 if (retval != 0){ 19 return retval; 20 } 21 } 22 23 return ret; 24 }