Handle the newer, larger sigset_t Linux now uses.

This commit is contained in:
fvdl 1999-10-04 17:46:37 +00:00
parent e93ada44ca
commit 6c6e28d62b
5 changed files with 83 additions and 32 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: linux_machdep.c,v 1.46 1999/01/08 11:59:38 kleink Exp $ */
/* $NetBSD: linux_machdep.c,v 1.47 1999/10/04 17:46:37 fvdl Exp $ */
/*-
* Copyright (c) 1995 The NetBSD Foundation, Inc.
@ -191,7 +191,7 @@ linux_sendsig(catcher, sig, mask, code)
/* XXX Linux doesn't support the signal stack. */
/* Save signal mask. */
native_to_linux_sigset(mask, &frame.sf_sc.sc_mask);
native_to_linux_old_sigset(mask, &frame.sf_sc.sc_mask);
if (copyout(&frame, fp, sizeof(frame)) != 0) {
/*
@ -302,7 +302,7 @@ linux_sys_sigreturn(p, v, retval)
p->p_sigacts->ps_sigstk.ss_flags &= ~SS_ONSTACK;
/* Restore signal mask. */
linux_to_native_sigset(&context.sc_mask, &mask);
linux_old_to_native_sigset(&context.sc_mask, &mask);
(void) sigprocmask1(p, SIG_SETMASK, &mask, 0);
return (EJUSTRETURN);

View File

@ -1,4 +1,4 @@
/* $NetBSD: linux_machdep.h,v 1.9 1998/10/04 00:02:26 fvdl Exp $ */
/* $NetBSD: linux_machdep.h,v 1.10 1999/10/04 17:46:37 fvdl Exp $ */
/*-
* Copyright (c) 1995 The NetBSD Foundation, Inc.
@ -64,9 +64,8 @@ struct linux_sigcontext {
int sc_esp_at_signal;
int sc_ss;
int sc_387;
/* XXX XAX is this sigset_t? old_sigset_t? */
/* XXX XAX what happens with RT sigs? */
linux_sigset_t sc_mask;
/* XXX check this */
linux_old_sigset_t sc_mask;
int sc_cr2;
};

View File

@ -1,4 +1,4 @@
/* $NetBSD: linux_sigarray.c,v 1.16 1998/10/04 00:02:27 fvdl Exp $ */
/* $NetBSD: linux_sigarray.c,v 1.17 1999/10/04 17:46:37 fvdl Exp $ */
/*-
* Copyright (c) 1995, 1998 The NetBSD Foundation, Inc.
@ -43,7 +43,7 @@
#include <compat/linux/common/linux_signal.h>
int linux_to_native_sig[LINUX_NSIG] = {
int linux_to_native_sig[LINUX__NSIG] = {
0,
SIGHUP,
SIGINT,
@ -76,5 +76,36 @@ int linux_to_native_sig[LINUX_NSIG] = {
SIGIO,
SIGPWR,
0, /* SIGUNUSED */
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
};

View File

@ -1,4 +1,4 @@
/* $NetBSD: linux_signal.h,v 1.7 1998/10/04 00:02:27 fvdl Exp $ */
/* $NetBSD: linux_signal.h,v 1.8 1999/10/04 17:46:37 fvdl Exp $ */
/*-
* Copyright (c) 1995, 1998 The NetBSD Foundation, Inc.
@ -73,16 +73,7 @@
#define LINUX_SIGUNUSED 31
#define LINUX_NSIG 32
/*
* XXX We don't really support linux real-time (>32) signals
* XXX we now have >32 signals. FIXME!
* XXX old linux_sigset_t are assumed to be the same size.
*/
#if 0
#define LINUX__NSIG 64
#else
#define LINUX__NSIG 32
#endif
#define LINUX__NSIG_BPW 32
#define LINUX__NSIG_WORDS (LINUX__NSIG / LINUX__NSIG_BPW)

View File

@ -1,4 +1,4 @@
/* $NetBSD: linux_signal.c,v 1.23 1999/09/30 19:32:53 tron Exp $ */
/* $NetBSD: linux_signal.c,v 1.24 1999/10/04 17:46:37 fvdl Exp $ */
/*-
* Copyright (c) 1995, 1998 The NetBSD Foundation, Inc.
* All rights reserved.
@ -332,7 +332,6 @@ linux_sys_rt_sigaction(p, v, retval)
struct sigaction nbsa, obsa;
int error;
/* XXX XAX linux_sigset_t or struct linux_sigaction here? */
if (SCARG(uap, sigsetsize) != sizeof(linux_sigset_t))
return (EINVAL);
@ -412,18 +411,48 @@ linux_sys_rt_sigprocmask(p, v, retval)
syscallarg(size_t) sigsetsize;
} */ *uap = v;
/* Use non-rt function: sigsetsize is ignored. */
/* Assume sizeof(linux_sigset_t) == sizeof(linux_old_sigset_t) */
if (SCARG(uap, sigsetsize) != sizeof(linux_old_sigset_t)) {
#ifdef DEBUG_LINUX
printf("linux_sys_rt_sigprocmask: sigsetsize != sizeof(old_sigset_t)");
#endif
return(ENOSYS);
linux_sigset_t nlss, olss, *oset;
const linux_sigset_t *set;
sigset_t nbss, obss;
int error, how;
if (SCARG(uap, sigsetsize) != sizeof(linux_sigset_t))
return (EINVAL);
switch (SCARG(uap, how)) {
case LINUX_SIG_BLOCK:
how = SIG_BLOCK;
break;
case LINUX_SIG_UNBLOCK:
how = SIG_UNBLOCK;
break;
case LINUX_SIG_SETMASK:
how = SIG_SETMASK;
break;
default:
return (EINVAL);
}
return(linux_sigprocmask1(p, SCARG(uap, how),
(const linux_old_sigset_t *)SCARG(uap, set),
(linux_old_sigset_t *)SCARG(uap, oset)));
set = SCARG(uap, set);
oset = SCARG(uap, oset);
if (set) {
error = copyin(set, &nlss, sizeof(nlss));
if (error)
return (error);
linux_to_native_sigset(&nlss, &nbss);
}
error = sigprocmask1(p, how,
set ? &nbss : 0, oset ? &obss : 0);
if (error)
return (error);
if (oset) {
native_to_linux_sigset(&obss, &olss);
error = copyout(&olss, oset, sizeof(olss));
if (error)
return (error);
}
return (error);
}
int
@ -446,6 +475,7 @@ linux_sys_rt_sigpending(p, v, retval)
native_to_linux_sigset(&bss, &lss);
return copyout(&lss, SCARG(uap, set), sizeof(lss));
}
int
linux_sys_sigpending(p, v, retval)
register struct proc *p;