/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License (the "License").
* You may not use this file except in compliance with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/*
* Copyright 2010 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
/* Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */
/* All Rights Reserved */
/*
* University Copyright- Copyright (c) 1982, 1986, 1988
* The Regents of the University of California
* All Rights Reserved
*
* University Acknowledgment- Portions of this document are derived from
* software developed by the University of California, Berkeley, and its
* contributors.
*/
#ifndef _UCB_SYS_SIGNAL_H
#define _UCB_SYS_SIGNAL_H
/*
* 4.3BSD signal compatibility header
*
* this file includes all standard SVR4 header info, plus the 4.3BSD
* structures - 4.3BSD signal codes are translated to SVR4 generic
* signal codes where applicable
*/
#ifdef __cplusplus
extern "C" {
#endif
/*
* SysV <signal.h>
*/
/* ---- <signal.h> ---- */
/* Copyright (c) 1988 AT&T */
/* All Rights Reserved */
#ifndef _SIGNAL_H
#define _SIGNAL_H
/* Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */
/* All Rights Reserved */
#ifndef _SYS_SIGNAL_H
#define _SYS_SIGNAL_H
#if defined(__cplusplus)
typedef void SIG_FUNC_TYP(int);
#define SIG_DFL (void(*)(int))0
#define SIG_ERR (void(*)(int))0
#define SIG_IGN (void (*)(int))0
#define SIG_HOLD (void(*)(int))0
#else
#define SIG_DFL (void(*)())0
#endif
#if !defined(_STRICT_STDC) || defined(_POSIX_SOURCE)
#ifndef _SIGSET_T
#define _SIGSET_T
typedef struct { /* signal set type */
} sigset_t;
#endif /* _SIGSET_T */
struct sigaction {
int sa_flags;
#if defined(__cplusplus)
void (*sa_handler)(int);
#else
void (*sa_handler)();
#endif
};
/* this is only valid for SIGCLD */
#endif
#if !defined(_STRICT_STDC) && !defined(_POSIX_SOURCE)
/* non-comformant ANSI compilation */
/* definitions for the sa_flags field */
/* this is only valid for SIGCLD */
struct sigaltstack {
char *ss_sp;
int ss_size;
int ss_flags;
};
#endif /* __STDC__ && !POSIX */
#endif /* _SYS_SIGNAL_H */
typedef int sig_atomic_t;
#if defined(__STDC__)
extern const char *_sys_siglist[];
extern const int _sys_nsig;
#ifdef __cplusplus
#else
extern void (*signal(int, void (*)(int)))(int);
#endif
extern int raise(int);
#if !defined(_STRICT_STDC) || defined(_POSIX_SOURCE) || \
defined(_XOPEN_SOURCE)
extern int sigemptyset(sigset_t *);
extern int sigfillset(sigset_t *);
extern int sigismember(const sigset_t *, int);
extern int sigpending(sigset_t *);
extern int sigsuspend(const sigset_t *);
#endif
#if !defined(_STRICT_STDC) && !defined(_POSIX_SOURCE)
extern int gsignal(int);
extern void (*sigset(int, void (*)(int)))(int);
extern int sighold(int);
extern int sigrelse(int);
extern int sigignore(int);
extern int sigpause(int);
extern int (*ssignal(int, int (*)(int)))(int);
/* extern int sigsend(idtype_t, id_t, int); */
/* extern int sigsendset(const procset_t *, int); */
#endif
#else
extern char *_sys_siglist[];
extern int _sys_nsig;
extern void(*signal())();
extern void(*sigset())();
#endif /* __STDC__ */
#endif /* _SIGNAL_H */
/* ---- end of SysV <signal.h> ---- */
/*
* 4.3BSD structure used in sigstack call.
*/
struct sigstack {
};
struct sigcontext {
#ifdef u3b2
#endif
#ifdef vax
#endif /* vax */
#ifdef mc68000
#endif /* mc68000 */
#ifdef __sparc
/* aliased to REG_CCR for sparcv9 */
long sc_o0;
#endif /* __sparc */
#if defined(__amd64)
#endif
};
/*
* 4.3BSD signal vector structure used in sigvec call.
*/
struct sigvec {
#if defined(__cplusplus)
#else
void (*sv_handler)(); /* signal handler */
#endif
};
#if defined(__STDC__)
extern int sigblock(int);
extern int sigsetmask(int);
#endif
/*
* Signal codes taken verbatim from SunOS4.1
*/
#ifdef vax
#endif /* vax */
#ifdef mc68000
#endif /* mc68000 */
#ifdef sparc
/* codes from 0x80 to 0xff are software traps */
#endif /* sparc */
#endif
#ifdef mc68000
#endif /* mc68000 */
#ifdef sparc
#endif /* sparc */
#ifdef vax
#endif /* vax */
#ifdef mc68000
#ifdef sun
#endif /* sun */
#endif /* mc68000 */
#ifdef sparc
#endif /* sparc */
/*
* The codes for SIGBUS and SIGSEGV are described in <vm/faultcode.h>
* These are the same between SunOS4.1 and SunOS5.0
*/
#include <vm/faultcode.h>
#ifdef BUS_OBJERR /* namespace conflict with SysV */
#endif
/*
* The BUS_CODE(code) will be one of the above. In the BUS_OBJERR case,
* doing a BUS_ERRNO(code) gives an errno value reported by the underlying
* file object mapped at the fault address. Note that this appears to be
* duplicated with the segmentation fault case below -- unfortunate, since
* the specification has always claimed that such errors produce SIGBUS.
* The segmentation cases are left defined as a transition aid.
*/
/*
* The SEGV_CODE(code) will be SEGV_NOMAP, SEGV_PROT, or SEGV_OBJERR.
* In the SEGV_OBJERR case, doing a SEGV_ERRNO(code) gives an errno value
* reported by the underlying file object mapped at the fault address.
*/
#define SIG_NOADDR ((char *)~0)
#if defined(lint)
#define BADSIG (void(*)())0
#else
#endif
#ifdef __cplusplus
}
#endif
#endif /* _UCB_SYS_SIGNAL_H */