/*
* Copyright 2005 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
/* Copyright (c) 1983, 1984, 1985, 1986, 1987, 1988, 1989 AT&T */
/* All Rights Reserved */
/*
* Copyright (c) 1980 Regents of the University of California.
* All rights reserved. The Berkeley Software License Agreement
* specifies the terms and conditions for redistribution.
*/
/*
* 4.3BSD signal compatibility functions
*
* the implementation interprets signal masks equal to -1 as "all of the
* signals in the signal set", thereby allowing signals with numbers
* above 32 to be blocked when referenced in code such as:
*
* for (i = 0; i < NSIG; i++)
* mask |= sigmask(i)
*/
#include <ucontext.h>
#include <signal.h>
#include "signal.h"
#include <errno.h>
#include <stdio.h>
/*
* sigstack is emulated with sigaltstack by guessing an appropriate
* value for the stack size - on machines that have stacks that grow
* upwards, the ss_sp arguments for both functions mean the same thing,
* (the initial stack pointer sigstack() is also the stack base
* sigaltstack()), so a "very large" value should be chosen for the
* stack size - on machines that have stacks that grow downwards, the
* ss_sp arguments mean opposite things, so 0 should be used (hopefully
* these machines don't have hardware stack bounds registers that pay
* attention to sigaltstack()'s size argument.
*/
#ifdef sun
#define SIGSTACKSIZE 0
#endif
/*
* sigvechandler is the real signal handler installed for all
* signals handled in the 4.3BSD compatibility interface - it translates
* SVR4 signal hander arguments into 4.3BSD signal handler arguments
* and then calls the real handler
*/
static void
{
int code;
char *addr;
int i, j;
int gwinswitch = 0;
/*
* Machine dependent code begins
*/
/*
* Machine dependent code ends
*/
else
addr = SIG_NOADDR;
if (sc.sc_onstack)
else
/*
* Machine dependent code begins
*/
/*
* Machine dependent code ends
*/
setcontext (ucp);
}
int
{
}
int
{
}
int
{
return (sigsuspend(&set));
}
int
{
return -1;
}
if (nvec) {
else
/*
if ( sig == SIGTSTP || sig == SIGSTOP )
nact.sa_handler = SIG_DFL; */
} else
return -1;
}
if (ovec) {
else
}
return 0;
}
void (*
signal(int s, void (*a)()))()
{
nsv.sv_handler = a;
return (SIG_ERR);
return (SIG_ERR);
}
return (osv.sv_handler);
}