Modify the recent sigaltstack() interface change to use the __RENAME() scheme;
add __sigaltstack14().
This commit is contained in:
parent
46f604677d
commit
5d7a8f4a16
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: signal.h,v 1.10 1997/11/26 16:51:13 kleink Exp $ */
|
||||
/* $NetBSD: signal.h,v 1.11 1997/11/29 18:38:20 kleink Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1991, 1993
|
||||
@ -111,9 +111,14 @@ int sigpause __P((int));
|
||||
int sigreturn __P((struct sigcontext *));
|
||||
int sigsetmask __P((int));
|
||||
int sigstack __P((const struct sigstack *, struct sigstack *));
|
||||
int sigaltstack __P((const stack_t *, stack_t *));
|
||||
int sigvec __P((int, struct sigvec *, struct sigvec *));
|
||||
void psignal __P((unsigned int, const char *));
|
||||
#ifdef __LIBC12_SOURCE__
|
||||
int sigaltstack __P((const struct sigaltstack13 *, struct sigaltstack13 *));
|
||||
int __sigaltstack14 __P((const stack_t *, stack_t *));
|
||||
#else
|
||||
int sigaltstack __P((const stack_t *, stack_t *)) __RENAME(__sigaltstack14);
|
||||
#endif
|
||||
#endif /* !_POSIX_SOURCE */
|
||||
#endif /* !_ANSI_SOURCE */
|
||||
__END_DECLS
|
||||
|
@ -1,4 +1,4 @@
|
||||
# $NetBSD: shlib_version,v 1.45 1997/11/02 16:59:40 kleink Exp $
|
||||
# $NetBSD: shlib_version,v 1.46 1997/11/29 18:38:22 kleink Exp $
|
||||
#
|
||||
major=12
|
||||
minor=21
|
||||
minor=22
|
||||
|
@ -1,4 +1,4 @@
|
||||
# $NetBSD: Makefile.inc,v 1.76 1997/11/06 22:34:01 cgd Exp $
|
||||
# $NetBSD: Makefile.inc,v 1.77 1997/11/29 18:38:23 kleink Exp $
|
||||
# @(#)Makefile.inc 8.1 (Berkeley) 6/17/93
|
||||
|
||||
# sys sources
|
||||
@ -20,8 +20,8 @@ DPSRCS+= Lint_Ovfork.c Lint_brk.c Lint_exect.c Lint_fork.c Lint_pipe.c \
|
||||
|
||||
# glue to provide compatibility between GCC 1.X and 2.X and for compat
|
||||
# with old syscall interfaces.
|
||||
SRCS+= ftruncate.c lseek.c mmap.c semctl.c truncate.c stat.c msync.c swapon.c \
|
||||
getdirentries.c
|
||||
SRCS+= ftruncate.c getdirentries.c lseek.c mmap.c msync.c semctl.c \
|
||||
sigaltstack.c stat.c swapon.c truncate.c
|
||||
|
||||
# "stub" POSIX.1b interfaces which return -1 and set errno to ENOSYS, so
|
||||
# we can avoid bumping libc's minor number as functions are added to the
|
||||
@ -55,7 +55,7 @@ ASM= accept.o access.o acct.o adjtime.o bind.o chdir.o chflags.o chmod.o \
|
||||
setpriority.o setregid.o setreuid.o \
|
||||
setrlimit.o setsid.o setsockopt.o settimeofday.o \
|
||||
setuid.o shmat.o shmctl.o shmdt.o shmget.o shutdown.o sigaction.o \
|
||||
sigaltstack.o socket.o socketpair.o __stat13.o statfs.o swapctl.o \
|
||||
__sigaltstack14.o socket.o socketpair.o __stat13.o statfs.o swapctl.o \
|
||||
symlink.o sysarch.o umask.o undelete.o unlink.o unmount.o \
|
||||
utimes.o vadvise.o wait4.o write.o writev.o __semctl.o __syscall.o \
|
||||
__sysctl.o
|
||||
|
69
lib/libc/sys/sigaltstack.c
Normal file
69
lib/libc/sys/sigaltstack.c
Normal file
@ -0,0 +1,69 @@
|
||||
/* $NetBSD: sigaltstack.c,v 1.1 1997/11/29 18:38:23 kleink Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1997 The NetBSD Foundation, Inc.
|
||||
* All rights reserved.
|
||||
*
|
||||
* This code is derived from software contributed to The NetBSD Foundation
|
||||
* by Klaus Klein.
|
||||
*
|
||||
* 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 NetBSD
|
||||
* Foundation, Inc. and its contributors.
|
||||
* 4. Neither the name of The NetBSD Foundation 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 NETBSD FOUNDATION, INC. 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 FOUNDATION 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.
|
||||
*/
|
||||
|
||||
#define __LIBC12_SOURCE__
|
||||
|
||||
#include <limits.h>
|
||||
#include <signal.h>
|
||||
#include <stddef.h>
|
||||
|
||||
int
|
||||
sigaltstack(onss, ooss)
|
||||
const struct sigaltstack13 *onss;
|
||||
struct sigaltstack13 *ooss;
|
||||
{
|
||||
stack_t nss, oss;
|
||||
int error;
|
||||
|
||||
nss.ss_sp = onss->ss_sp;
|
||||
nss.ss_size = onss->ss_size;
|
||||
nss.ss_flags = onss->ss_flags;
|
||||
|
||||
error = __sigaltstack14(&nss, &oss);
|
||||
|
||||
if (error == 0 && ooss != NULL) {
|
||||
ooss->ss_sp = oss.ss_sp;
|
||||
if (oss.ss_size > INT_MAX)
|
||||
ooss->ss_size = INT_MAX;
|
||||
else
|
||||
ooss->ss_size = oss.ss_size;
|
||||
ooss->ss_flags = oss.ss_flags;
|
||||
}
|
||||
|
||||
return (error);
|
||||
}
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: kern_sig_13.c,v 1.1 1997/11/25 19:32:17 kleink Exp $ */
|
||||
/* $NetBSD: kern_sig_13.c,v 1.2 1997/11/29 18:39:46 kleink Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1997 The NetBSD Foundation, Inc.
|
||||
@ -36,7 +36,6 @@
|
||||
* POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <sys/param.h>
|
||||
#include <sys/proc.h>
|
||||
#include <sys/signal.h>
|
||||
@ -45,6 +44,8 @@
|
||||
#include <sys/mount.h>
|
||||
#include <sys/syscallargs.h>
|
||||
|
||||
#include <machine/limits.h>
|
||||
|
||||
#include <compat/common/compat_util.h>
|
||||
|
||||
|
||||
@ -54,7 +55,7 @@ compat_13_sys_sigaltstack(p, v, retval)
|
||||
void *v;
|
||||
register_t *retval;
|
||||
{
|
||||
struct sys_sigaltstack_args ua;
|
||||
struct sys___sigaltstack14_args ua;
|
||||
struct compat_13_sys_sigaltstack_args /* {
|
||||
syscallarg(const struct sigaltstack13 *) nss;
|
||||
syscallarg(struct sigaltstack13 *) oss;
|
||||
@ -92,7 +93,7 @@ compat_13_sys_sigaltstack(p, v, retval)
|
||||
SCARG(&ua, nss) = nssp;
|
||||
SCARG(&ua, oss) = ossp;
|
||||
|
||||
error = sys_sigaltstack(p, &ua, retval);
|
||||
error = sys___sigaltstack14(p, &ua, retval);
|
||||
if (error != 0)
|
||||
return (error);
|
||||
|
||||
@ -103,7 +104,10 @@ compat_13_sys_sigaltstack(p, v, retval)
|
||||
return (error);
|
||||
|
||||
tmp13.ss_sp = tmp.ss_sp;
|
||||
tmp13.ss_size = (int)tmp.ss_size;
|
||||
if (tmp.ss_size > INT_MAX)
|
||||
tmp13.ss_size = INT_MAX;
|
||||
else
|
||||
tmp13.ss_size = tmp.ss_size;
|
||||
tmp13.ss_flags = tmp.ss_flags;
|
||||
|
||||
error = copyout(&tmp13, SCARG(uap, oss),
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: kern_sig.c,v 1.67 1997/10/16 02:45:39 mycroft Exp $ */
|
||||
/* $NetBSD: kern_sig.c,v 1.68 1997/11/29 18:38:24 kleink Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1982, 1986, 1989, 1991, 1993
|
||||
@ -345,12 +345,12 @@ sys_sigsuspend(p, v, retval)
|
||||
|
||||
/* ARGSUSED */
|
||||
int
|
||||
sys_sigaltstack(p, v, retval)
|
||||
sys___sigaltstack14(p, v, retval)
|
||||
struct proc *p;
|
||||
void *v;
|
||||
register_t *retval;
|
||||
{
|
||||
register struct sys_sigaltstack_args /* {
|
||||
register struct sys___sigaltstack14_args /* {
|
||||
syscallarg(const struct sigaltstack *) nss;
|
||||
syscallarg(struct sigaltstack *) oss;
|
||||
} */ *uap = v;
|
||||
|
@ -1,4 +1,4 @@
|
||||
$NetBSD: syscalls.master,v 1.65 1997/11/25 19:32:20 kleink Exp $
|
||||
$NetBSD: syscalls.master,v 1.66 1997/11/29 18:38:26 kleink Exp $
|
||||
|
||||
; @(#)syscalls.master 8.2 (Berkeley) 1/13/94
|
||||
|
||||
@ -516,5 +516,5 @@
|
||||
278 STD { int sys___stat13(const char *path, struct stat *ub); }
|
||||
279 STD { int sys___fstat13(int fd, struct stat *sb); }
|
||||
280 STD { int sys___lstat13(const char *path, struct stat *ub); }
|
||||
281 STD { int sys_sigaltstack(const struct sigaltstack *nss, \
|
||||
struct sigaltstack *oss); }
|
||||
281 STD { int sys___sigaltstack14(const struct sigaltstack \
|
||||
*nss, struct sigaltstack *oss); }
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: signal.h,v 1.24 1997/11/25 19:32:22 kleink Exp $ */
|
||||
/* $NetBSD: signal.h,v 1.25 1997/11/29 18:38:27 kleink Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1982, 1986, 1989, 1991, 1993
|
||||
@ -140,13 +140,11 @@ typedef void (*sig_t) __P((int)); /* type of signal function */
|
||||
/*
|
||||
* Structure used in sigaltstack call.
|
||||
*/
|
||||
#ifdef _KERNEL
|
||||
struct sigaltstack13 {
|
||||
char *ss_sp; /* signal stack base */
|
||||
int ss_size; /* signal stack length */
|
||||
int ss_flags; /* SS_DISABLE and/or SS_ONSTACK */
|
||||
};
|
||||
#endif
|
||||
|
||||
typedef struct
|
||||
#ifndef _XOPEN_SOURCE
|
||||
|
Loading…
Reference in New Issue
Block a user