1106424Sroberto/*- 2106424Sroberto * SPDX-License-Identifier: BSD-3-Clause 3132451Sroberto * 4106424Sroberto * Copyright (c) 1982, 1986, 1989, 1991, 1993 5106424Sroberto * The Regents of the University of California. All rights reserved. 6285612Sdelphij * (c) UNIX System Laboratories, Inc. 7106424Sroberto * All or some portions of this file are derived from material licensed 8106424Sroberto * to the University of California by American Telephone and Telegraph 9106424Sroberto * Co. or Unix System Laboratories, Inc. and are reproduced herein with 10106424Sroberto * the permission of UNIX System Laboratories, Inc. 11106424Sroberto * 12106424Sroberto * Redistribution and use in source and binary forms, with or without 13106424Sroberto * modification, are permitted provided that the following conditions 14106424Sroberto * are met: 15106424Sroberto * 1. Redistributions of source code must retain the above copyright 16106424Sroberto * notice, this list of conditions and the following disclaimer. 17106424Sroberto * 2. Redistributions in binary form must reproduce the above copyright 18106424Sroberto * notice, this list of conditions and the following disclaimer in the 19106424Sroberto * documentation and/or other materials provided with the distribution. 20106424Sroberto * 3. Neither the name of the University nor the names of its contributors 21106424Sroberto * may be used to endorse or promote products derived from this software 22106424Sroberto * without specific prior written permission. 23106424Sroberto * 24106424Sroberto * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 25106424Sroberto * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 26106424Sroberto * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 27106424Sroberto * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 28106424Sroberto * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 29106424Sroberto * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 30106424Sroberto * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 31106424Sroberto * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 32106424Sroberto * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 33106424Sroberto * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 34106424Sroberto * SUCH DAMAGE. 35182007Sroberto */ 36182007Sroberto 37182007Sroberto#ifndef _SYS__SIGALTSTACK_H_ 38182007Sroberto#define _SYS__SIGALTSTACK_H_ 39182007Sroberto 40106424Sroberto#include <sys/_types.h> 41106424Sroberto 42106424Sroberto#if __XSI_VISIBLE 43106424Sroberto#if __BSD_VISIBLE 44106424Sroberto#define __stack_t sigaltstack 45106424Sroberto#endif 46106424Srobertotypedef struct __stack_t stack_t; 47106424Sroberto 48106424Sroberto#define SS_ONSTACK 0x0001 /* take signal on alternate stack */ 49106424Sroberto#define SS_DISABLE 0x0004 /* disable taking signals on alternate stack */ 50106424Sroberto#define MINSIGSTKSZ __MINSIGSTKSZ /* minimum stack size */ 51106424Sroberto#define SIGSTKSZ (MINSIGSTKSZ + 32768) /* recommended stack size */ 52106424Sroberto#endif 53106424Sroberto 54106424Sroberto/* 55106424Sroberto * Structure used in sigaltstack call. Its definition is always 56132451Sroberto * needed for __ucontext. If __BSD_VISIBLE is defined, the structure 57182007Sroberto * tag is actually sigaltstack. 58182007Sroberto */ 59182007Srobertostruct __stack_t { 60182007Sroberto void *ss_sp; /* signal stack base */ 61182007Sroberto __size_t ss_size; /* signal stack length */ 62182007Sroberto int ss_flags; /* SS_DISABLE and/or SS_ONSTACK */ 63182007Sroberto}; 64182007Sroberto 65182007Sroberto#endif /* !_SYS__SIGALTSTACK_H_ */ 66182007Sroberto