summaryrefslogtreecommitdiffstats
path: root/sys/i386/svr4
diff options
context:
space:
mode:
authormarcel <marcel@FreeBSD.org>1999-09-29 15:12:18 +0000
committermarcel <marcel@FreeBSD.org>1999-09-29 15:12:18 +0000
commitbd000d73ad75473ad7201663ffb27c36ab130f0e (patch)
treebc01945dc4b7113b39c954abf475834f0e086487 /sys/i386/svr4
parenta16d76cb5680cf0afd1a3be9be9d1f7ea686a96c (diff)
downloadFreeBSD-src-bd000d73ad75473ad7201663ffb27c36ab130f0e.zip
FreeBSD-src-bd000d73ad75473ad7201663ffb27c36ab130f0e.tar.gz
sigset_t change (part 4 of 5)
----------------------------- The compatibility code and/or emulators have been updated: iBCS2 now mostly uses the older syscalls. SVR4 now properly handles all signals. This has been achieved by using the new sigset_t throughout the emulator. The Linuxulator has been severely updated. Internally the new Linux sigset_t is made the default. These are then mapped to and from the new FreeBSD sigset_t. Also, rt_sigsuspend has been implemented in the Linuxulator. Implementing this syscall basicly caused all this sigset_t changing in the first place and the syscall has been used throughout the change as a means for testing. It basicly is too much work to undo the implementation so that it can later be added again. A special note on the use of sv_sigtbl and sv_sigsize in struct sysentvec: Every signal larger than sv_sigsize is not translated and is passed on to the signal handler unmodified. Signals in the range 1 upto and including sv_sigsize are translated. The rationale is that only the system defined signals need to be translated. The emulators also have been updated so that the translation tables are only indexed for valid (system defined) signals. This change also fixes the translation bug already in the SVR4 emulator.
Diffstat (limited to 'sys/i386/svr4')
-rw-r--r--sys/i386/svr4/svr4_machdep.c16
-rw-r--r--sys/i386/svr4/svr4_machdep.h2
2 files changed, 10 insertions, 8 deletions
diff --git a/sys/i386/svr4/svr4_machdep.c b/sys/i386/svr4/svr4_machdep.c
index 6118289..bc2e469 100644
--- a/sys/i386/svr4/svr4_machdep.c
+++ b/sys/i386/svr4/svr4_machdep.c
@@ -78,7 +78,6 @@ extern char svr4_sigcode[];
extern int _udatasel, _ucodesel;
static void svr4_getsiginfo __P((union svr4_siginfo *, int, u_long, caddr_t));
-extern int bsd_to_svr4_sig[];
#if !defined(__NetBSD__)
/* taken from /sys/arch/i386/include/psl.h on NetBSD-1.3 */
@@ -105,7 +104,8 @@ void
svr4_getcontext(p, uc, mask, oonstack)
struct proc *p;
struct svr4_ucontext *uc;
- int mask, oonstack;
+ sigset_t *mask;
+ int oonstack;
{
struct trapframe *tf = p->p_md.md_regs;
svr4_greg_t *r = uc->uc_mcontext.greg;
@@ -171,7 +171,7 @@ svr4_getcontext(p, uc, mask, oonstack)
/*
* Set the signal mask
*/
- bsd_to_svr4_sigset(&mask, &uc->uc_sigmask);
+ bsd_to_svr4_sigset(mask, &uc->uc_sigmask);
/*
* Set the flags
@@ -200,7 +200,7 @@ svr4_setcontext(p, uc)
svr4_greg_t *r = uc->uc_mcontext.greg;
struct svr4_sigaltstack *s = &uc->uc_stack;
struct sigaltstack *sf = &psp->ps_sigstk;
- int mask;
+ sigset_t mask;
/*
* XXX:
@@ -276,7 +276,8 @@ svr4_setcontext(p, uc)
*/
if (uc->uc_flags & SVR4_UC_SIGMASK) {
svr4_to_bsd_sigset(&uc->uc_sigmask, &mask);
- p->p_sigmask = mask & ~sigcantmask;
+ p->p_sigmask = mask;
+ SIG_CANTMASK(p->p_sigmask);
}
return 0; /*EJUSTRETURN;*/
@@ -389,7 +390,8 @@ svr4_getsiginfo(si, sig, code, addr)
void
svr4_sendsig(catcher, sig, mask, code)
sig_t catcher;
- int sig, mask;
+ int sig;
+ sigset_t *mask;
u_long code;
{
register struct proc *p = curproc;
@@ -405,7 +407,7 @@ svr4_sendsig(catcher, sig, mask, code)
* Allocate space for the signal handler context.
*/
if ((psp->ps_flags & SAS_ALTSTACK) && !oonstack &&
- (psp->ps_sigonstack & sigmask(sig))) {
+ SIGISMEMBER(psp->ps_sigonstack, sig)) {
fp = (struct svr4_sigframe *)((caddr_t)psp->ps_sigstk.ss_sp +
psp->ps_sigstk.ss_size - sizeof(struct svr4_sigframe));
psp->ps_sigstk.ss_flags |= SS_ONSTACK;
diff --git a/sys/i386/svr4/svr4_machdep.h b/sys/i386/svr4/svr4_machdep.h
index f183e60..5546d27 100644
--- a/sys/i386/svr4/svr4_machdep.h
+++ b/sys/i386/svr4/svr4_machdep.h
@@ -73,7 +73,7 @@ typedef struct {
struct svr4_ucontext;
void svr4_getcontext __P((struct proc *, struct svr4_ucontext *,
- int, int));
+ sigset_t *, int));
int svr4_setcontext __P((struct proc *p, struct svr4_ucontext *));
typedef struct {
OpenPOWER on IntegriCloud