Use a private implementation of sys_sigvec(). Ultrix uses an sv_flags bit

unknown to NetBSD and sigaction1() does (now?) complain about it.
This commit is contained in:
drochner 1998-10-03 16:13:20 +00:00
parent 192330fdc1
commit 720885a1e9
2 changed files with 54 additions and 4 deletions

View File

@ -1,4 +1,4 @@
$NetBSD: syscalls.master,v 1.26 1998/09/26 16:24:14 drochner Exp $
$NetBSD: syscalls.master,v 1.27 1998/10/03 16:13:20 drochner Exp $
; @(#)syscalls.master 8.1 (Berkeley) 7/19/93
@ -171,7 +171,7 @@
int name, caddr_t val, int valsize); }
106 NOARGS { int sys_listen(int s, int backlog); }
107 UNIMPL vtimes
108 NOARGS { int compat_43_sys_sigvec(int signum, \
108 STD { int ultrix_sys_sigvec(int signum, \
struct sigvec *nsv, struct sigvec *osv); }
109 NOARGS { int compat_43_sys_sigblock(int mask); }
110 NOARGS { int compat_43_sys_sigsetmask(int mask); }

View File

@ -1,4 +1,4 @@
/* $NetBSD: ultrix_misc.c,v 1.45 1998/10/02 18:53:23 drochner Exp $ */
/* $NetBSD: ultrix_misc.c,v 1.46 1998/10/03 16:13:20 drochner Exp $ */
/*
* Copyright (c) 1995, 1997 Jonathan Stone (hereinafter referred to as the author)
@ -83,7 +83,7 @@
#include <sys/cdefs.h> /* RCS ID & Copyright macro defns */
__KERNEL_RCSID(0, "$NetBSD: ultrix_misc.c,v 1.45 1998/10/02 18:53:23 drochner Exp $");
__KERNEL_RCSID(0, "$NetBSD: ultrix_misc.c,v 1.46 1998/10/03 16:13:20 drochner Exp $");
/*
* SunOS compatibility module.
@ -683,6 +683,56 @@ ultrix_sys_sigsuspend(p, v, retval)
return (sigsuspend1(p, &ss));
}
#define ULTRIX_SV_ONSTACK 0x0001 /* take signal on signal stack */
#define ULTRIX_SV_INTERRUPT 0x0002 /* do not restart system on signal return */
#define ULTRIX_SV_OLDSIG 0x1000 /* Emulate old signal() for POSIX */
int
ultrix_sys_sigvec(p, v, retval)
struct proc *p;
void *v;
register_t *retval;
{
struct ultrix_sys_sigvec_args *uap = v;
struct sigvec nsv, osv;
struct sigaction nsa, osa;
int error;
if (SCARG(uap, nsv)) {
error = copyin(SCARG(uap, nsv), &nsv, sizeof(nsv));
if (error)
return (error);
nsa.sa_handler = nsv.sv_handler;
#if 0 /* documentation */
/* ONSTACK is identical */
nsa.sa_flags = nsv.sv_flags & ULTRIX_SV_ONSTACK;
if ((nsv.sv_flags & ULTRIX_SV_OLDSIG)
/* old signal() - always restart */
|| (!(nsv.sv_flags & ULTRIX_SV_INTERRUPT))
/* inverted meaning (same bit) */
)
nsa.sa_flags |= SA_RESTART;
#else /* optimized - assuming ULTRIX_SV_OLDSIG=>!ULTRIX_SV_INTERRUPT */
nsa.sa_flags = nsv.sv_flags & ~ULTRIX_SV_OLDSIG;
nsa.sa_flags ^= SA_RESTART;
#endif
native_sigset13_to_sigset(&nsv.sv_mask, &nsa.sa_mask);
}
error = sigaction1(p, SCARG(uap, signum),
SCARG(uap, nsv) ? &nsa : 0, SCARG(uap, osv) ? &osa : 0);
if (error)
return (error);
if (SCARG(uap, osv)) {
osv.sv_handler = osa.sa_handler;
osv.sv_flags = osa.sa_flags ^ SA_RESTART;
osv.sv_flags &= (ULTRIX_SV_ONSTACK | ULTRIX_SV_INTERRUPT);
native_sigset_to_sigset13(&osa.sa_mask, &osv.sv_mask);
error = copyout(&osv, SCARG(uap, osv), sizeof(osv));
if (error)
return (error);
}
return (0);
}
int
ultrix_sys_shmsys(p, v, retval)