1*7c30b7e1Sthorpej /* $NetBSD: compat_missing.c,v 1.2 2021/11/02 06:54:10 thorpej Exp $ */
2a121fa65Schristos
3a121fa65Schristos /*-
4a121fa65Schristos * Copyright (c) 2020 The NetBSD Foundation, Inc.
5a121fa65Schristos * All rights reserved.
6a121fa65Schristos *
7a121fa65Schristos * This code is derived from software contributed to The NetBSD Foundation
8a121fa65Schristos * by Christos Zoulas.
9a121fa65Schristos *
10a121fa65Schristos * Redistribution and use in source and binary forms, with or without
11a121fa65Schristos * modification, are permitted provided that the following conditions
12a121fa65Schristos * are met:
13a121fa65Schristos * 1. Redistributions of source code must retain the above copyright
14a121fa65Schristos * notice, this list of conditions and the following disclaimer.
15a121fa65Schristos * 2. Redistributions in binary form must reproduce the above copyright
16a121fa65Schristos * notice, this list of conditions and the following disclaimer in the
17a121fa65Schristos * documentation and/or other materials provided with the distribution.
18a121fa65Schristos *
19a121fa65Schristos * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
20a121fa65Schristos * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
21a121fa65Schristos * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
22a121fa65Schristos * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
23a121fa65Schristos * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
24a121fa65Schristos * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
25a121fa65Schristos * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
26a121fa65Schristos * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
27a121fa65Schristos * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
28a121fa65Schristos * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
29a121fa65Schristos * POSSIBILITY OF SUCH DAMAGE.
30a121fa65Schristos */
31a121fa65Schristos
32a121fa65Schristos #include <sys/cdefs.h>
33*7c30b7e1Sthorpej __RCSID("$NetBSD: compat_missing.c,v 1.2 2021/11/02 06:54:10 thorpej Exp $");
34a121fa65Schristos
35a121fa65Schristos /*
36a121fa65Schristos * define symbols that autoconf is supposed to find
37a121fa65Schristos * without including the standard headers
38a121fa65Schristos */
39a121fa65Schristos #define __LIBC12_SOURCE__
40a121fa65Schristos #include <signal.h>
41a121fa65Schristos
42a121fa65Schristos __warn_references(sigaction,
43a121fa65Schristos "warning: reference to compatibility sigaction(); include <signal.h> to generate correct reference")
44a121fa65Schristos __warn_references(sigpending,
45a121fa65Schristos "warning: reference to compatibility sigpending(); include <signal.h> to generate correct reference")
46a121fa65Schristos __warn_references(sigprocmask,
47a121fa65Schristos "warning: reference to compatibility sigprocmask(); include <signal.h> to generate correct reference")
48a121fa65Schristos __warn_references(sigsuspend,
49a121fa65Schristos "warning: reference to compatibility sigsuspend(); include <signal.h> to generate correct reference")
50a121fa65Schristos
51a121fa65Schristos int sigaction(int, const struct sigaction * restrict,
52a121fa65Schristos struct sigaction * restrict);
53*7c30b7e1Sthorpej int __sigaction_siginfo(int, const struct sigaction * restrict,
54a121fa65Schristos struct sigaction * restrict);
55a121fa65Schristos
56a121fa65Schristos int
sigaction(int sig,const struct sigaction * restrict act,struct sigaction * restrict oact)57a121fa65Schristos sigaction(int sig, const struct sigaction * restrict act,
58a121fa65Schristos struct sigaction * restrict oact)
59a121fa65Schristos {
60*7c30b7e1Sthorpej return __sigaction_siginfo(sig, act, oact);
61a121fa65Schristos }
62a121fa65Schristos
63a121fa65Schristos int sigpending(sigset_t *);
64a121fa65Schristos int __sigpending14(sigset_t *);
65a121fa65Schristos
66a121fa65Schristos int
sigpending(sigset_t * mask)67a121fa65Schristos sigpending(sigset_t *mask)
68a121fa65Schristos {
69a121fa65Schristos return __sigpending14(mask);
70a121fa65Schristos }
71a121fa65Schristos
72a121fa65Schristos int sigprocmask(int how, const sigset_t * restrict set,
73a121fa65Schristos sigset_t * restrict oset);
74a121fa65Schristos int __sigprocmask14(int how, const sigset_t * restrict set,
75a121fa65Schristos sigset_t * restrict oset);
76a121fa65Schristos
77a121fa65Schristos int
sigprocmask(int how,const sigset_t * restrict set,sigset_t * restrict oset)78a121fa65Schristos sigprocmask(int how, const sigset_t * restrict set, sigset_t * restrict oset)
79a121fa65Schristos {
80a121fa65Schristos return __sigprocmask14(how, set, oset);
81a121fa65Schristos }
82a121fa65Schristos
83a121fa65Schristos int sigsuspend(const sigset_t *);
84a121fa65Schristos int __sigsuspend14(const sigset_t *);
85a121fa65Schristos
86a121fa65Schristos int
sigsuspend(const sigset_t * mask)87a121fa65Schristos sigsuspend(const sigset_t *mask)
88a121fa65Schristos {
89a121fa65Schristos return __sigsuspend14(mask);
90a121fa65Schristos }
91