summaryrefslogblamecommitdiff
path: root/src/signal/sigaltstack.c
blob: cfa3f5c19d0de03384ff3f1a3b884149626db07b (plain) (tree)
1
2
3
4
5
6
7
8
9
10
11
                   
                  

                    
                                                                  
 




                                                
                                                



                                       
                                                 
 
#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_ONSTACK) {
			errno = EINVAL;
			return -1;
		}
	}
	return syscall(SYS_sigaltstack, ss, old);
}