summaryrefslogtreecommitdiff
path: root/src/signal/sigaltstack.c
blob: 550f2f9df892b4a7b18f0f4de57b7562f4be73de (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#include <signal.h>
#include <errno.h>
#include "syscall.h"

int sigaltstack(const stack_t *ss, stack_t *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);
}