xref: /haiku/src/system/libroot/posix/signal/set_signal_stack.c (revision 079c69cbfd7cd3c97baae91332251c8388a8bb02)
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 <syscalls.h>
11 
12 
13 void
14 set_signal_stack(void *ptr, size_t size)
15 {
16 	stack_t alternateStack;
17 	status_t status;
18 
19 	alternateStack.ss_sp = ptr;
20 	alternateStack.ss_size = size;
21 	alternateStack.ss_flags = 0;
22 
23 	status = _kern_set_signal_stack(&alternateStack, NULL);
24 	if (status < B_OK)
25 		errno = status;
26 }
27 
28 
29