/*
* 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 _SYS_SIGNAL_H
#define _SYS_SIGNAL_H
#include <sys/feature_tests.h>
#ifdef __cplusplus
extern "C" {
#endif
defined(__XOPEN_OR_POSIX)
#if defined(__EXTENSIONS__) || defined(_KERNEL) || \
(!defined(_STRICT_STDC) && !defined(__XOPEN_OR_POSIX)) || \
/*
*/
#endif
/* Duplicated in <sys/ucontext.h> as a result of XPG4v2 requirements */
#ifndef _SIGSET_T
#define _SIGSET_T
typedef struct { /* signal set type */
} sigset_t;
#endif /* _SIGSET_T */
typedef struct {
} k_sigset_t;
/*
* The signal handler routine can have either one or three arguments.
* Existing C code has used either form so not specifing the arguments
* neatly finesses the problem. C++ doesn't accept this. To C++
* "(*sa_handler)()" indicates a routine with no arguments (ANSI C would
* specify this as "(*sa_handler)(void)"). One or the other form must be
* used for C++ and the only logical choice is "(*sa_handler)(int)" to allow
* the SIG_* defines to work. "(*sa_sigaction)(int, siginfo_t *, void *)"
* can be used for the three argument form.
*/
/*
* Note: storage overlap by sa_handler and sa_sigaction
*/
struct sigaction {
int sa_flags;
union {
#ifdef __cplusplus
void (*_handler)(int);
#else
void (*_handler)();
#endif
#if defined(__EXTENSIONS__) || defined(_KERNEL) || \
(!defined(_STRICT_STDC) && !defined(__XOPEN_OR_POSIX)) || \
#endif
} _funcptr;
#ifndef _LP64
#endif
};
#if defined(_SYSCALL32)
/* Kernel view of the ILP32 user sigaction structure */
struct sigaction32 {
union {
} _funcptr;
};
#endif /* _SYSCALL32 */
/* this is only valid for SIGCLD */
#endif
#if defined(__EXTENSIONS__) || defined(_KERNEL) || \
(!defined(_STRICT_STDC) && !defined(_POSIX_C_SOURCE)) || \
defined(_XPG4_2)
/* non-conformant ANSI compilation */
/* definitions for the sa_flags field */
#endif
#if defined(__EXTENSIONS__) || defined(_KERNEL) || \
(!defined(_STRICT_STDC) && !defined(_POSIX_C_SOURCE)) || \
#endif
#if defined(__EXTENSIONS__) || defined(_KERNEL) || \
(!defined(_STRICT_STDC) && !defined(__XOPEN_OR_POSIX)) || \
defined(_XPG4_2)
/* this is only valid for SIGCLD */
#if defined(__EXTENSIONS__) || !defined(_XPG4_2)
/*
* use of these symbols by applications is injurious
* to binary compatibility
*/
#endif /* defined(__EXTENSIONS__) || !defined(_XPG4_2) */
/* Duplicated in <sys/ucontext.h> as a result of XPG4v2 requirements. */
#ifndef _STACK_T
#define _STACK_T
#if defined(__EXTENSIONS__) || !defined(_XPG4_2)
typedef struct sigaltstack {
#else
typedef struct {
#endif
void *ss_sp;
int ss_flags;
} stack_t;
#if defined(_SYSCALL32)
/* Kernel view of the ILP32 user sigaltstack structure */
typedef struct sigaltstack32 {
} stack32_t;
#endif /* _SYSCALL32 */
#endif /* _STACK_T */
#endif /* defined(__EXTENSIONS__) || defined(_KERNEL) ... */
#if defined(__EXTENSIONS__) || defined(_KERNEL) || \
(!defined(_STRICT_STDC) && !defined(__XOPEN_OR_POSIX))
/* signotify id used only by libc for mq_notify()/aio_notify() */
#if defined(_SYSCALL32)
/* Kernel view of the ILP32 user signotify_id structure */
typedef struct signotify32_id {
#endif /* _SYSCALL32 */
/* Command codes for sig_notify call */
#endif /* defined(__EXTENSIONS__) || defined(_KERNEL) ... */
/* Added as per XPG4v2 */
#if defined(__EXTENSIONS__) || defined(_KERNEL) || \
(!defined(_STRICT_STDC) && !defined(__XOPEN_OR_POSIX)) || \
defined(_XPG4_2)
struct sigstack {
void *ss_sp;
int ss_onstack;
};
#endif /* defined(__EXTENSIONS__) || defined(_KERNEL) ... */
/*
* For definition of ucontext_t; must follow struct definition
* for sigset_t
*/
#if defined(_XPG4_2)
#include <sys/ucontext.h>
#endif /* defined(_XPG4_2) */
#ifdef _KERNEL
#else
#error "fix me: MAXSIG out of bounds"
#endif
#define CANTMASK1 0
#define CANTMASK2 0
(s)->__sigbits[2]))
typedef struct {
} sigsend_t;
typedef struct {
} signotifyq_t;
} sigqhdr_t;
extern void setsigact(int, void (*)(int), const k_sigset_t *, int);
extern void sigintr(k_sigset_t *, int);
extern void sigunintr(k_sigset_t *);
#endif /* _KERNEL */
#ifdef __cplusplus
}
#endif
#endif /* _SYS_SIGNAL_H */