1 /* 2 * CDDL HEADER START 3 * 4 * The contents of this file are subject to the terms of the 5 * Common Development and Distribution License (the "License"). 6 * You may not use this file except in compliance with the License. 7 * 8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 9 * or http://www.opensolaris.org/os/licensing. 10 * See the License for the specific language governing permissions 11 * and limitations under the License. 12 * 13 * When distributing Covered Code, include this CDDL HEADER in each 14 * file and include the License file at usr/src/OPENSOLARIS.LICENSE. 15 * If applicable, add the following below this CDDL HEADER, with the 16 * fields enclosed by brackets "[]" replaced with your own identifying 17 * information: Portions Copyright [yyyy] [name of copyright owner] 18 * 19 * CDDL HEADER END 20 */ 21 /* Copyright (c) 1988 AT&T */ 22 /* All Rights Reserved */ 23 24 25 /* 26 * Copyright 2007 Sun Microsystems, Inc. All rights reserved. 27 * Use is subject to license terms. 28 */ 29 /* 30 * Copyright 2014 Garrett D'Amore <garrett@damore.org> 31 */ 32 33 #ifndef _UCONTEXT_H 34 #define _UCONTEXT_H 35 36 #include <sys/ucontext.h> 37 38 #if !defined(_XPG4_2) || defined(__EXTENSIONS__) 39 #include <sys/siginfo.h> 40 #endif 41 42 #ifdef __cplusplus 43 extern "C" { 44 #endif 45 46 /* 47 * Arguably, under _XPG7, applications should not even include this 48 * header, since it isn't part of Issue 7. We apply some paranoia for 49 * the functions that were explicity removed, although we could likely 50 * just ignore the darn thing altogether. 51 */ 52 #if (!defined(_STRICT_SYMBOLS)) || (defined(_XPG4_2) && !defined(_XPG7)) 53 54 #ifdef __sparc 55 #ifdef __PRAGMA_REDEFINE_EXTNAME 56 #pragma redefine_extname makecontext __makecontext_v2 57 #else 58 #define makecontext __makecontext_v2 59 #endif 60 #endif 61 62 extern int getcontext(ucontext_t *) __RETURNS_TWICE; 63 #pragma unknown_control_flow(getcontext) 64 extern int setcontext(const ucontext_t *) __NORETURN; 65 extern int swapcontext(ucontext_t *_RESTRICT_KYWD, 66 const ucontext_t *_RESTRICT_KYWD); 67 extern void makecontext(ucontext_t *, void(*)(), int, ...); 68 #endif 69 70 #if !defined(_XPG4_2) || defined(__EXTENSIONS__) 71 extern int walkcontext(const ucontext_t *, int (*)(uintptr_t, int, void *), 72 void *); 73 extern int printstack(int); 74 extern int addrtosymstr(void *, char *, int); 75 extern int getustack(stack_t **); 76 extern int setustack(stack_t *); 77 78 extern int stack_getbounds(stack_t *); 79 extern int stack_setbounds(const stack_t *); 80 extern int stack_inbounds(void *); 81 extern int stack_violation(int, const siginfo_t *, const ucontext_t *); 82 83 extern void *_stack_grow(void *); 84 #endif 85 86 #ifdef __cplusplus 87 } 88 #endif 89 90 #endif /* _UCONTEXT_H */