signal.h revision 1539
11539Srgrimes/*-
21539Srgrimes * Copyright (c) 1991, 1993
31539Srgrimes *	The Regents of the University of California.  All rights reserved.
41539Srgrimes *
51539Srgrimes * Redistribution and use in source and binary forms, with or without
61539Srgrimes * modification, are permitted provided that the following conditions
71539Srgrimes * are met:
81539Srgrimes * 1. Redistributions of source code must retain the above copyright
91539Srgrimes *    notice, this list of conditions and the following disclaimer.
101539Srgrimes * 2. Redistributions in binary form must reproduce the above copyright
111539Srgrimes *    notice, this list of conditions and the following disclaimer in the
121539Srgrimes *    documentation and/or other materials provided with the distribution.
131539Srgrimes * 3. All advertising materials mentioning features or use of this software
141539Srgrimes *    must display the following acknowledgement:
151539Srgrimes *	This product includes software developed by the University of
161539Srgrimes *	California, Berkeley and its contributors.
171539Srgrimes * 4. Neither the name of the University nor the names of its contributors
181539Srgrimes *    may be used to endorse or promote products derived from this software
191539Srgrimes *    without specific prior written permission.
201539Srgrimes *
211539Srgrimes * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
221539Srgrimes * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
231539Srgrimes * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
241539Srgrimes * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
251539Srgrimes * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
261539Srgrimes * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
271539Srgrimes * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
281539Srgrimes * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
291539Srgrimes * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
301539Srgrimes * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
311539Srgrimes * SUCH DAMAGE.
321539Srgrimes *
331539Srgrimes *	@(#)signal.h	8.3 (Berkeley) 3/30/94
341539Srgrimes */
351539Srgrimes
361539Srgrimes#ifndef _USER_SIGNAL_H
371539Srgrimes#define _USER_SIGNAL_H
381539Srgrimes
391539Srgrimes#include <sys/types.h>
401539Srgrimes#include <sys/cdefs.h>
411539Srgrimes#include <sys/signal.h>
421539Srgrimes
431539Srgrimes#if !defined(_ANSI_SOURCE) && !defined(_POSIX_SOURCE)
441539Srgrimesextern __const char *__const sys_signame[NSIG];
451539Srgrimesextern __const char *__const sys_siglist[NSIG];
461539Srgrimes#endif
471539Srgrimes
481539Srgrimes__BEGIN_DECLS
491539Srgrimesint	raise __P((int));
501539Srgrimes#ifndef	_ANSI_SOURCE
511539Srgrimesint	kill __P((pid_t, int));
521539Srgrimesint	sigaction __P((int, const struct sigaction *, struct sigaction *));
531539Srgrimesint	sigaddset __P((sigset_t *, int));
541539Srgrimesint	sigdelset __P((sigset_t *, int));
551539Srgrimesint	sigemptyset __P((sigset_t *));
561539Srgrimesint	sigfillset __P((sigset_t *));
571539Srgrimesint	sigismember __P((const sigset_t *, int));
581539Srgrimesint	sigpending __P((sigset_t *));
591539Srgrimesint	sigprocmask __P((int, const sigset_t *, sigset_t *));
601539Srgrimesint	sigsuspend __P((const sigset_t *));
611539Srgrimes#ifndef _POSIX_SOURCE
621539Srgrimesint	killpg __P((pid_t, int));
631539Srgrimesint	sigblock __P((int));
641539Srgrimesint	siginterrupt __P((int, int));
651539Srgrimesint	sigpause __P((int));
661539Srgrimesint	sigreturn __P((struct sigcontext *));
671539Srgrimesint	sigsetmask __P((int));
681539Srgrimesint	sigstack __P((const struct sigstack *, struct sigstack *));
691539Srgrimesint	sigvec __P((int, struct sigvec *, struct sigvec *));
701539Srgrimesvoid	psignal __P((unsigned int, const char *));
711539Srgrimes#endif	/* !_POSIX_SOURCE */
721539Srgrimes#endif	/* !_ANSI_SOURCE */
731539Srgrimes__END_DECLS
741539Srgrimes
751539Srgrimes/* List definitions after function declarations, or Reiser cpp gets upset. */
761539Srgrimes#define	sigaddset(set, signo)	(*(set) |= 1 << ((signo) - 1), 0)
771539Srgrimes#define	sigdelset(set, signo)	(*(set) &= ~(1 << ((signo) - 1)), 0)
781539Srgrimes#define	sigemptyset(set)	(*(set) = 0, 0)
791539Srgrimes#define	sigfillset(set)		(*(set) = ~(sigset_t)0, 0)
801539Srgrimes#define	sigismember(set, signo)	((*(set) & (1 << ((signo) - 1))) != 0)
811539Srgrimes
821539Srgrimes#endif	/* !_USER_SIGNAL_H */
83