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 <OS.h> 8 9 #include <errno.h> 10 11 #include <errno_private.h> 12 #include <syscalls.h> 13 14 15 void 16 set_signal_stack(void *ptr, size_t size) 17 { 18 stack_t alternateStack; 19 status_t status; 20 21 alternateStack.ss_sp = ptr; 22 alternateStack.ss_size = size; 23 alternateStack.ss_flags = 0; 24 25 status = _kern_set_signal_stack(&alternateStack, NULL); 26 if (status < B_OK) 27 __set_errno(status); 28 } 29 30 31