vfs: check userland buffers before reading them.
[haiku.git] / src / system / libroot / posix / signal / set_signal_stack.c
blob89b547d898ebe1c3c6bc0b830c6e6332c923ad81
1 /*
2 * Copyright 2007, Axel Dörfler, axeld@pinc-software.de.
3 * Distributed under the terms of the MIT License.
4 */
7 #include <OS.h>
9 #include <errno.h>
11 #include <errno_private.h>
12 #include <syscalls.h>
15 void
16 set_signal_stack(void *ptr, size_t size)
18 stack_t alternateStack;
19 status_t status;
21 alternateStack.ss_sp = ptr;
22 alternateStack.ss_size = size;
23 alternateStack.ss_flags = 0;
25 status = _kern_set_signal_stack(&alternateStack, NULL);
26 if (status < B_OK)
27 __set_errno(status);