xref: /netbsd-src/lib/libc/compat/include/signal.h (revision ace5b9b5feb0e7608bd2da7a617428d2e1cf8aa3)
1*ace5b9b5Schristos /*	$NetBSD: signal.h,v 1.4 2024/01/20 14:52:46 christos Exp $	*/
25b84b398Schristos 
35b84b398Schristos /*-
45b84b398Schristos  * Copyright (c) 1991, 1993
55b84b398Schristos  *	The Regents of the University of California.  All rights reserved.
65b84b398Schristos  *
75b84b398Schristos  * Redistribution and use in source and binary forms, with or without
85b84b398Schristos  * modification, are permitted provided that the following conditions
95b84b398Schristos  * are met:
105b84b398Schristos  * 1. Redistributions of source code must retain the above copyright
115b84b398Schristos  *    notice, this list of conditions and the following disclaimer.
125b84b398Schristos  * 2. Redistributions in binary form must reproduce the above copyright
135b84b398Schristos  *    notice, this list of conditions and the following disclaimer in the
145b84b398Schristos  *    documentation and/or other materials provided with the distribution.
155b84b398Schristos  * 3. Neither the name of the University nor the names of its contributors
165b84b398Schristos  *    may be used to endorse or promote products derived from this software
175b84b398Schristos  *    without specific prior written permission.
185b84b398Schristos  *
195b84b398Schristos  * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
205b84b398Schristos  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
215b84b398Schristos  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
225b84b398Schristos  * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
235b84b398Schristos  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
245b84b398Schristos  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
255b84b398Schristos  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
265b84b398Schristos  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
275b84b398Schristos  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
285b84b398Schristos  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
295b84b398Schristos  * SUCH DAMAGE.
305b84b398Schristos  *
315b84b398Schristos  *	@(#)signal.h	8.3 (Berkeley) 3/30/94
325b84b398Schristos  */
335b84b398Schristos 
345b84b398Schristos #ifndef _COMPAT_SIGNAL_H_
355b84b398Schristos #define _COMPAT_SIGNAL_H_
365b84b398Schristos 
375b84b398Schristos #include <compat/sys/signal.h>
385b84b398Schristos 
395b84b398Schristos __BEGIN_DECLS
40*ace5b9b5Schristos #if defined(_NETBSD_SOURCE)
41*ace5b9b5Schristos extern const char *const _sys_signame[];
42*ace5b9b5Schristos extern const char *const _sys_siglist[];
43*ace5b9b5Schristos extern const int sys_nsig;
44*ace5b9b5Schristos #endif
45*ace5b9b5Schristos 
465b84b398Schristos int	sigaction(int, const struct sigaction13 * __restrict,
475b84b398Schristos     struct sigaction13 * __restrict);
487c30b7e1Sthorpej int	__sigaction_siginfo(int, const struct sigaction * __restrict,
495b84b398Schristos     struct sigaction * __restrict);
505b84b398Schristos int	sigaddset(sigset13_t *, int);
515b84b398Schristos int	__sigaddset14(sigset_t *, int);
525b84b398Schristos int	sigdelset(sigset13_t *, int);
535b84b398Schristos int	__sigdelset14(sigset_t *, int);
545b84b398Schristos int	sigemptyset(sigset13_t *);
555b84b398Schristos int	__sigemptyset14(sigset_t *);
565b84b398Schristos int	sigfillset(sigset13_t *);
575b84b398Schristos int	__sigfillset14(sigset_t *);
585b84b398Schristos int	sigismember(const sigset13_t *, int);
595b84b398Schristos int	__sigismember14(const sigset_t *, int);
605b84b398Schristos int	sigpending(sigset13_t *);
615b84b398Schristos int	__sigpending14(sigset_t *);
625b84b398Schristos int	sigprocmask(int, const sigset13_t * __restrict,
635b84b398Schristos     sigset13_t * __restrict);
645b84b398Schristos int	__sigprocmask14(int, const sigset_t * __restrict,
655b84b398Schristos     sigset_t * __restrict);
665b84b398Schristos int	sigsuspend(const sigset13_t *);
675b84b398Schristos int	__sigsuspend14(const sigset_t *);
685b84b398Schristos 
69461a86f9Schristos int	sigtimedwait(const sigset_t * __restrict,
70461a86f9Schristos     siginfo_t * __restrict, const struct timespec50 * __restrict);
71461a86f9Schristos int	__sigtimedwait(const sigset_t * __restrict,
72461a86f9Schristos     siginfo_t * __restrict, struct timespec50 * __restrict);
73461a86f9Schristos int	__sigtimedwait50(const sigset_t * __restrict,
74461a86f9Schristos     siginfo_t * __restrict, const struct timespec * __restrict);
75461a86f9Schristos int	____sigtimedwait50(const sigset_t * __restrict,
76461a86f9Schristos     siginfo_t * __restrict, struct timespec * __restrict);
77*ace5b9b5Schristos int	__libc_sigaction14(int, const struct sigaction *, struct sigaction *);
78*ace5b9b5Schristos 
795b84b398Schristos /*
805b84b398Schristos  * X/Open CAE Specification Issue 4 Version 2
815b84b398Schristos  */
825b84b398Schristos #if (defined(_XOPEN_SOURCE) && defined(_XOPEN_SOURCE_EXTENDED)) || \
835b84b398Schristos     (_XOPEN_SOURCE - 0) >= 500 || defined(_NETBSD_SOURCE)
845b84b398Schristos int	sigaltstack(const struct sigaltstack13 * __restrict,
855b84b398Schristos     struct sigaltstack13 * __restrict);
865b84b398Schristos int	__sigaltstack14(const stack_t * __restrict, stack_t * __restrict);
875b84b398Schristos #endif /* _XOPEN_SOURCE_EXTENDED || _XOPEN_SOURCE >= 500 || _NETBSD_SOURCE */
885b84b398Schristos 
89*ace5b9b5Schristos #define C(a,b) __CONCAT(a,b)
90*ace5b9b5Schristos #define __SIGTRAMP_SIGCONTEXT  \
91*ace5b9b5Schristos     C(__sigtramp_sigcontext_,__SIGTRAMP_SIGCONTEXT_VERSION)
92*ace5b9b5Schristos #define __SIGTRAMP_SIGINFO  \
93*ace5b9b5Schristos     C(__sigtramp_siginfo_,__SIGTRAMP_SIGINFO_VERSION)
94*ace5b9b5Schristos 
95*ace5b9b5Schristos extern const char __SIGTRAMP_SIGINFO[];
96*ace5b9b5Schristos extern const char __SIGTRAMP_SIGCONTEXT[];
97*ace5b9b5Schristos 
985b84b398Schristos __END_DECLS
995b84b398Schristos 
1005b84b398Schristos #endif	/* !_COMPAT_SIGNAL_H_ */
101