From 1ebb9bf289affe8849f15bc757a6eab338ba79a4 Mon Sep 17 00:00:00 2001 From: christos Date: Sat, 26 Sep 1998 23:53:36 +0000 Subject: [PATCH] Adapt to new signal changes (from Jason) --- lib/libc/gen/Lint___setjmp14.c | 24 +++++++ lib/libc/gen/Lint___sigsetjmp14.c | 25 +++++++ lib/libc/gen/Makefile.inc | 12 ++-- lib/libc/gen/__sigsetops14.c | 112 ++++++++++++++++++++++++++++++ lib/libc/gen/siglist.c | 6 +- lib/libc/gen/sigsetops.c | 30 ++++---- 6 files changed, 186 insertions(+), 23 deletions(-) create mode 100644 lib/libc/gen/Lint___setjmp14.c create mode 100644 lib/libc/gen/Lint___sigsetjmp14.c create mode 100644 lib/libc/gen/__sigsetops14.c diff --git a/lib/libc/gen/Lint___setjmp14.c b/lib/libc/gen/Lint___setjmp14.c new file mode 100644 index 000000000000..4d6f970bd932 --- /dev/null +++ b/lib/libc/gen/Lint___setjmp14.c @@ -0,0 +1,24 @@ +/* $NetBSD: Lint___setjmp14.c,v 1.1 1998/09/26 23:53:36 christos Exp $ */ + +/* + * This file placed in the public domain. + * Chris Demetriou, November 5, 1997. + */ + +#include + +/*ARGSUSED*/ +int +__setjmp14(env) + jmp_buf env; +{ + return (0); +} + +/*ARGSUSED*/ +void +__longjmp14(env, val) + jmp_buf env; + int val; +{ +} diff --git a/lib/libc/gen/Lint___sigsetjmp14.c b/lib/libc/gen/Lint___sigsetjmp14.c new file mode 100644 index 000000000000..004610bd250d --- /dev/null +++ b/lib/libc/gen/Lint___sigsetjmp14.c @@ -0,0 +1,25 @@ +/* $NetBSD: Lint___sigsetjmp14.c,v 1.1 1998/09/26 23:53:36 christos Exp $ */ + +/* + * This file placed in the public domain. + * Chris Demetriou, November 5, 1997. + */ + +#include + +/*ARGSUSED*/ +int +__sigsetjmp14(env, savemask) + sigjmp_buf env; + int savemask; +{ + return (0); +} + +/*ARGSUSED*/ +void +__siglongjmp14(env, val) + sigjmp_buf env; + int val; +{ +} diff --git a/lib/libc/gen/Makefile.inc b/lib/libc/gen/Makefile.inc index 8f736181b610..9254a6fa1164 100644 --- a/lib/libc/gen/Makefile.inc +++ b/lib/libc/gen/Makefile.inc @@ -1,4 +1,4 @@ -# $NetBSD: Makefile.inc,v 1.92 1998/07/28 19:58:25 mycroft Exp $ +# $NetBSD: Makefile.inc,v 1.93 1998/09/26 23:53:36 christos Exp $ # from: @(#)Makefile.inc 8.6 (Berkeley) 5/4/95 # gen sources @@ -18,11 +18,11 @@ SRCS+= _errno.c alarm.c assert.c basename.c clock.c closedir.c \ pause.c popen.c psignal.c pwcache.c pw_scan.c raise.c readdir.c \ rewinddir.c scandir.c seekdir.c setdomainname.c \ sethostname.c setjmperr.c setmode.c setproctitle.c \ - siginterrupt.c siglist.c signal.c signame.c sigsetops.c \ - sleep.c stringlist.c sysconf.c sysctl.c syslog.c telldir.c \ - time.c times.c timezone.c tolower_.c ttyname.c ttyslot.c \ - toupper_.c ualarm.c uname.c unvis.c usleep.c utime.c \ - valloc.c vis.c wait.c wait3.c waitpid.c warn.c warnx.c \ + siginterrupt.c siglist.c signal.c \ + signame.c __sigsetops14.c sigsetops.c sleep.c stringlist.c sysconf.c \ + sysctl.c syslog.c telldir.c time.c times.c timezone.c tolower_.c \ + ttyname.c ttyslot.c toupper_.c ualarm.c uname.c unvis.c usleep.c \ + utime.c valloc.c vis.c wait.c wait3.c waitpid.c warn.c warnx.c \ vwarn.c vwarnx.c verr.c verrx.c # indirect reference stubs, to be removed soon. diff --git a/lib/libc/gen/__sigsetops14.c b/lib/libc/gen/__sigsetops14.c new file mode 100644 index 000000000000..01430af00900 --- /dev/null +++ b/lib/libc/gen/__sigsetops14.c @@ -0,0 +1,112 @@ +/* $NetBSD: __sigsetops14.c,v 1.1 1998/09/26 23:53:36 christos Exp $ */ + +/*- + * Copyright (c) 1989, 1993 + * The Regents of the University of California. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by the University of + * California, Berkeley and its contributors. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * @(#)sigsetops.c 8.1 (Berkeley) 6/4/93 + */ + +#include +#if defined(LIBC_SCCS) && !defined(lint) +#if 0 +static char sccsid[] = "@(#)sigsetops.c 8.1 (Berkeley) 6/4/93"; +#else +__RCSID("$NetBSD: __sigsetops14.c,v 1.1 1998/09/26 23:53:36 christos Exp $"); +#endif +#endif /* LIBC_SCCS and not lint */ + +#define __LIBC12_SOURCE__ + +#include +#include + +#undef sigemptyset +#undef sigfillset +#undef sigaddset +#undef sigdelset +#undef sigismember + +int +__sigemptyset14(set) + sigset_t *set; +{ + + __sigemptyset(set); + return (0); +} + +int +__sigfillset14(set) + sigset_t *set; +{ + + __sigfillset(set); + return (0); +} + +int +__sigaddset14(set, signo) + sigset_t *set; + int signo; +{ + if (signo <= 0 || signo >= NSIG) { + errno = EINVAL; + return -1; + } + __sigaddset(set, signo); + return (0); +} + +int +__sigdelset14(set, signo) + sigset_t *set; + int signo; +{ + if (signo <= 0 || signo >= NSIG) { + errno = EINVAL; + return -1; + } + __sigdelset(set, signo); + return (0); +} + +int +__sigismember14(set, signo) + const sigset_t *set; + int signo; +{ + if (signo <= 0 || signo >= NSIG) { + errno = EINVAL; + return -1; + } + return (__sigismember(set, signo)); +} diff --git a/lib/libc/gen/siglist.c b/lib/libc/gen/siglist.c index 5c09ae7f1ad0..3f297dab136f 100644 --- a/lib/libc/gen/siglist.c +++ b/lib/libc/gen/siglist.c @@ -1,4 +1,4 @@ -/* $NetBSD: siglist.c,v 1.9 1997/07/13 19:46:16 christos Exp $ */ +/* $NetBSD: siglist.c,v 1.10 1998/09/26 23:53:36 christos Exp $ */ /* * Copyright (c) 1983, 1993 @@ -38,14 +38,14 @@ #if 0 static char sccsid[] = "@(#)siglist.c 8.1 (Berkeley) 6/4/93"; #else -__RCSID("$NetBSD: siglist.c,v 1.9 1997/07/13 19:46:16 christos Exp $"); +__RCSID("$NetBSD: siglist.c,v 1.10 1998/09/26 23:53:36 christos Exp $"); #endif #endif /* LIBC_SCCS and not lint */ #include #include -const char *const _sys_siglist[NSIG] = { +const char *const _sys_siglist[SIGUSR2+1] = { "Signal 0", "Hangup", /* SIGHUP */ "Interrupt", /* SIGINT */ diff --git a/lib/libc/gen/sigsetops.c b/lib/libc/gen/sigsetops.c index 50bf6902df88..93426fc4d8c7 100644 --- a/lib/libc/gen/sigsetops.c +++ b/lib/libc/gen/sigsetops.c @@ -1,4 +1,4 @@ -/* $NetBSD: sigsetops.c,v 1.11 1997/07/13 19:46:19 christos Exp $ */ +/* $NetBSD: sigsetops.c,v 1.12 1998/09/26 23:53:36 christos Exp $ */ /*- * Copyright (c) 1989, 1993 @@ -40,10 +40,12 @@ #if 0 static char sccsid[] = "@(#)sigsetops.c 8.1 (Berkeley) 6/4/93"; #else -__RCSID("$NetBSD: sigsetops.c,v 1.11 1997/07/13 19:46:19 christos Exp $"); +__RCSID("$NetBSD: sigsetops.c,v 1.12 1998/09/26 23:53:36 christos Exp $"); #endif #endif /* LIBC_SCCS and not lint */ +#define __LIBC12_SOURCE__ + #include #include @@ -55,7 +57,7 @@ __RCSID("$NetBSD: sigsetops.c,v 1.11 1997/07/13 19:46:19 christos Exp $"); int sigemptyset(set) - sigset_t *set; + sigset13_t *set; { *set = 0; return (0); @@ -63,46 +65,46 @@ sigemptyset(set) int sigfillset(set) - sigset_t *set; + sigset13_t *set; { - *set = ~(sigset_t)0; + *set = ~(sigset13_t)0; return (0); } int sigaddset(set, signo) - sigset_t *set; + sigset13_t *set; int signo; { - if (signo <= 0 || signo >= NSIG) { + if (signo <= 0 || signo >= NSIG13) { errno = EINVAL; return -1; } - *set |= sigmask(signo); + *set |= __sigmask13(signo); return (0); } int sigdelset(set, signo) - sigset_t *set; + sigset13_t *set; int signo; { - if (signo <= 0 || signo >= NSIG) { + if (signo <= 0 || signo >= NSIG13) { errno = EINVAL; return -1; } - *set &= ~sigmask(signo); + *set &= ~__sigmask13(signo); return (0); } int sigismember(set, signo) - const sigset_t *set; + const sigset13_t *set; int signo; { - if (signo <= 0 || signo >= NSIG) { + if (signo <= 0 || signo >= NSIG13) { errno = EINVAL; return -1; } - return ((*set & sigmask(signo)) != 0); + return ((*set & __sigmask13(signo)) != 0); }