/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License (the "License").
* You may not use this file except in compliance with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/*
* Copyright 2009 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 */
/*
* Portions of this source code were derived from Berkeley 4.3 BSD
* under license from the Regents of the University of California.
*/
/*
* 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 <errno.h>
#include "libc.h"
/* forward declarations */
int ucbsigsetmask(int);
int ucbsigblock(int);
int ucbsigpause(int);
int ucbsiginterrupt(int, int);
/*
* 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 ucbsigvechandler();
void
{
}
static void
{
int code;
char *addr;
int i, j;
int gwinswitch = 0;
#if defined(__amd64)
#else
#endif
/*
* Translate signal codes from new to old.
* /usr/ucbinclude/sys/signal.h contains old codes.
*/
code = 0;
addr = SIG_NOADDR;
switch (sig) {
case SIGILL:
case SIGFPE:
break;
case SIGBUS:
case BUS_ADRALN:
break;
case BUS_ADRERR:
break;
default: /* BUS_OBJERR */
break;
}
break;
case SIGSEGV:
case SEGV_MAPERR:
code = SEGV_NOMAP;
break;
case SEGV_ACCERR:
break;
default:
break;
}
break;
default:
addr = SIG_NOADDR;
break;
}
}
if (sc.sc_onstack)
else
#if defined(__amd64)
#else
#endif
}
int
{
return (ucbsigsetmask(mask));
}
int
{
}
int
{
return (ucbsigblock(mask));
}
int
{
}
int
{
return (ucbsigpause(mask));
}
int
{
int ret;
return (ret);
}
int
{
}
int
{
return (-1);
}
return (-1);
}
if (nvec) {
/*
* To be compatible with the behavior of SunOS 4.x:
* If the new signal handler is SIG_IGN or SIG_DFL,
* do not change the signal's entry in the handler array.
* This allows a child of vfork(2) to set signal handlers
* to SIG_IGN or SIG_DFL without affecting the parent.
*/
} else {
}
} else
return (-1);
}
if (ovec) {
else
}
return (0);
}
int
{
if (nss) {
/*
* assumes stack growth is down (like sparc and x86)
*/
} else
naltp = (struct sigaltstack *)0;
return (-1);
if (oss) {
/*
* assumes stack growth is down (like sparc and x86)
*/
}
return (0);
}
void (*
ucbsignal(int s, void (*a)()))()
{
nsv.sv_handler = a;
return (SIG_ERR);
return (SIG_ERR);
}
return (osv.sv_handler);
}
void (*
usignal(int s, void (*a)()))()
{
return (ucbsignal(s, a));
}
/*
* Set signal state to prevent restart of system calls
* after an instance of the indicated signal.
*/
int
{
}
int
{
int ret;
return (ret);
if (flag)
else
}