xref: /haiku/src/system/libroot/posix/signal/sigaltstack.c (revision 1deede7388b04dbeec5af85cae7164735ea9e70d)
1 /*
2  * Copyright 2007, Axel Dörfler, axeld@pinc-software.de.
3  * Distributed under the terms of the MIT License.
4  */
5 
6 
7 #include <errno.h>
8 #include <signal.h>
9 
10 #include <errno_private.h>
11 #include <syscalls.h>
12 
13 
14 int
15 sigaltstack(const stack_t *alternateStack, stack_t *oldAlternateStack)
16 {
17 	status_t status =_kern_set_signal_stack(alternateStack, oldAlternateStack);
18 	if (status < B_OK) {
19 		__set_errno(status);
20 		return -1;
21 	}
22 
23 	return 0;
24 }
25