siginfo.h revision 7c478bd95313f5f23a4c958a745db2134aa03244
/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License, Version 1.0 only
* (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 2004 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
/* Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */
/* All Rights Reserved */
#ifndef _SYS_SIGINFO_H
#define _SYS_SIGINFO_H
#pragma ident "%Z%%M% %I% %E% SMI"
#include <sys/feature_tests.h>
#ifdef __cplusplus
extern "C" {
#endif
defined(__EXTENSIONS__)
/*
* POSIX requirements.
*/
#ifndef _SIGVAL
#define _SIGVAL
union sigval {
int sival_int; /* integer value */
void *sival_ptr; /* pointer value */
};
#endif /* _SIGVAL */
#if defined(_SYSCALL32)
/* Kernel view of user ILP32 sigval */
union sigval32 {
};
#endif /* _SYSCALL32 */
#else /* needed in siginfo_t structure */
union __sigval {
int __sival_int; /* integer value */
void *__sival_ptr; /* pointer value */
};
#endif /* !defined(_POSIX_C_SOURCE) || (_POSIX_C_SOURCE > 2)... */
defined(__EXTENSIONS__)
/*
* POSIX requirements.
*/
#ifndef _SIGEVENT
#define _SIGEVENT
struct sigevent {
int sigev_notify; /* notification mode */
int sigev_signo; /* signal number */
void (*sigev_notify_function)(union sigval);
int __sigev_pad2;
};
#endif /* _SIGEVENT */
/* values of sigev_notify */
#if defined(_SYSCALL32)
/* Kernel view of user ILP32 sigevent */
struct sigevent32 {
};
#endif /* _SYSCALL32 */
#endif /* !defined(__XOPEN_OR_POSIX) || (_POSIX_C_SOURCE > 2)... */
defined(__EXTENSIONS__)
/*
* negative signal codes are reserved for future use for user generated
* signals
*/
#define SI_USER 0 /* user generated signal via kill() */
#endif /* !defined(_POSIX_C_SOURCE) || (_POSIX_C_SOURCE > 2)... */
/*
* Get the machine dependent signal codes (SIGILL, SIGFPE, SIGSEGV, and
*/
/*
* SIGTRAP signal codes
*/
#if !defined(_XOPEN_SOURCE) || defined(__EXTENSIONS__)
#define NSIGTRAP 6
#endif /* !defined(_XOPEN_SOURCE) || defined(__EXTENSIONS__) */
/*
* SIGCLD signal codes
*/
#if !defined(_XOPEN_SOURCE) || defined(__EXTENSIONS__)
#define NSIGCLD 6
#endif /* !defined(_XOPEN_SOURCE) || defined(__EXTENSIONS__) */
/*
* SIGPOLL signal codes
*/
#if !defined(_XOPEN_SOURCE) || defined(__EXTENSIONS__)
#define NSIGPOLL 6
#endif /* !defined(_XOPEN_SOURCE) || defined(__EXTENSIONS__) */
#endif /* !defined(_POSIX_C_SOURCE) || defined(_XPG4_2) ... */
#if !defined(__XOPEN_OR_POSIX) || defined(__EXTENSIONS__)
/*
* SIGPROF signal codes
*/
#define NSIGPROF 1
#endif /* !defined(__XOPEN_OR_POSIX) || defined (__EXTENSIONS__) */
defined(__EXTENSIONS__)
#ifdef _LP64
#define SI_MAXSZ 256
#else
#define SI_MAXSZ 128
#endif
/*
* Inclusion of <sys/time_impl.h> is needed for the declaration of
* timestruc_t. However, since inclusion of <sys/time_impl.h> results
* timestruct_t has been duplicated in a standards namespace safe header
* <sys/time_std_impl.h>. In <sys/time_std_impl.h>, the structure
* name, tag, and member names, as well as the type itself, all have
* leading underscores to protect namespace.
*/
#if !defined(__XOPEN_OR_POSIX) || defined(__EXTENSIONS__)
#include <sys/time_impl.h>
#else
#include <sys/time_std_impl.h>
#endif /* !defined(__XOPEN_OR_POSIX) || defined(__EXTENSIONS__) */
/*
* follow that definition.
*/
#if !defined(__XOPEN_OR_POSIX) || defined(__EXTENSIONS__)
#else
typedef struct {
#endif
int si_code; /* code from above */
#ifdef _LP64
int si_pad; /* _LP64 union starts on an 8-byte boundary */
#endif
union {
struct { /* kill(), SIGCLD, siqqueue() */
union {
struct {
defined(__EXTENSIONS__)
#else
#endif
} __kill;
struct {
int __status;
} __cld;
} __pdata;
} __proc;
struct { /* SIGSEGV, SIGBUS, SIGILL, SIGTRAP, SIGFPE */
void *__addr; /* faulting address */
int __trapno; /* illegal trap number */
} __fault;
struct { /* SIGPOLL, SIGXFSZ */
/* fd not currently available for SIGPOLL */
int __fd; /* file descriptor */
long __band;
} __file;
struct { /* SIGPROF */
#if !defined(__XOPEN_OR_POSIX) || defined(__EXTENSIONS__)
#else
#endif
short __syscall; /* current syscall */
char __nsysarg; /* number of arguments */
char __fault; /* last fault type */
} __prof;
struct { /* SI_RCTL */
} __rctl;
} __data;
} siginfo_t;
#if defined(_SYSCALL32)
/* Kernel view of user ILP32 siginfo struct */
#define SI32_MAXSZ 128
typedef struct siginfo32 {
union {
struct { /* kill(), SIGCLD, siqqueue() */
union {
struct {
} __kill;
struct {
} __cld;
} __pdata;
} __proc;
struct { /* SIGSEGV, SIGBUS, SIGILL, SIGTRAP, SIGFPE */
} __fault;
struct { /* SIGPOLL, SIGXFSZ */
/* fd not currently available for SIGPOLL */
} __file;
struct { /* SIGPROF */
} __prof;
struct { /* SI_RCTL */
} __rctl;
} __data;
} siginfo32_t;
#endif /* _SYSCALL32 */
/*
* XXX -- internal version is identical to siginfo_t but without the padding.
* This must be maintained in sync with it.
*/
#if !defined(__XOPEN_OR_POSIX) || defined(__EXTENSIONS__)
typedef struct k_siginfo {
int si_code; /* code from above */
#ifdef _LP64
int si_pad; /* _LP64 union starts on an 8-byte boundary */
#endif
union {
struct { /* kill(), SIGCLD, siqqueue() */
union {
struct {
} __kill;
struct {
int __status;
} __cld;
} __pdata;
} __proc;
struct { /* SIGSEGV, SIGBUS, SIGILL, SIGTRAP, SIGFPE */
void *__addr; /* faulting address */
int __trapno; /* illegal trap number */
} __fault;
struct { /* SIGPOLL, SIGXFSZ */
/* fd not currently available for SIGPOLL */
int __fd; /* file descriptor */
long __band;
} __file;
struct { /* SIGPROF */
#if !defined(__XOPEN_OR_POSIX) || defined(__EXTENSIONS__)
#else
#endif
short __syscall; /* current syscall */
char __nsysarg; /* number of arguments */
char __fault; /* last fault type */
/* these are omitted to keep k_siginfo_t small */
/* long __sysarg[8]; */
/* int __mstate[10]; */
} __prof;
struct { /* SI_RCTL */
} __rctl;
} __data;
} k_siginfo_t;
typedef struct sigqueue {
void *sq_backptr; /* pointer to the data structure */
/* associated by sq_func() */
int sq_external; /* comes from outside the contract */
} sigqueue_t;
/* indication whether to queue the signal or not */
#define SI_CANQUEUE(c) ((c) <= SI_QUEUE)
#endif /* !defined(__XOPEN_OR_POSIX) || defined(__EXTENSIONS__) */
#endif /* !defined(_POSIX_C_SOURCE) || (_POSIX_C_SOURCE > 2) ... */
#if defined(_SYSCALL32_IMPL)
#endif /* _SYSCALL32_IMPL */
#ifdef __cplusplus
}
#endif
#endif /* _SYS_SIGINFO_H */