ssig.c revision ae115bc77f6fcde83175c75b4206dc2e50747966
/*
* 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 (c) 1984, 1986, 1987, 1988, 1989 AT&T */
/* All Rights Reserved */
/*
* Copyright 2007 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#pragma ident "%Z%%M% %I% %E% SMI"
#include <sys/sysmacros.h>
#include <sys/schedctl.h>
/*
* ssig() is the old common entry for signal, sigset, sighold,
* sigrelse, sigignore and sigpause.
*
* All of these interfaces have been reimplemented in libc using
* calls to sigaction, sigsuspend and sigprocmask.
*
* This kernel interface is no longer called by any application
* that is dynamically linked with libc. It exists solely for
* the benefit of really old statically-linked applications.
* It should be removed from the system.
*/
int
{
int sig;
struct proc *p;
int flags;
int retval = 0;
int sigcld_look = 0;
mutex_enter(&p->p_lock);
switch (signo & ~SIGNO_MASK) {
case SIGHOLD: /* sighold */
mutex_exit(&p->p_lock);
return (0);
case SIGRELSE: /* sigrelse */
mutex_exit(&p->p_lock);
return (0);
case SIGPAUSE: /* sigpause */
/* pause() */
;
mutex_exit(&p->p_lock);
case SIGIGNORE: /* signore */
flags = 0;
break;
case SIGDEFER: /* sigset */
else
mutex_exit(&p->p_lock);
return (retval);
}
#if defined(__sparc)
/*
* Check alignment of handler
*/
mutex_exit(&p->p_lock);
}
#endif
flags = 0;
break;
case 0: /* signal */
#if defined(__sparc)
/*
* Check alignment of handler
*/
mutex_exit(&p->p_lock);
}
#endif
break;
default: /* error */
mutex_exit(&p->p_lock);
}
flags |= SA_RESTART;
flags |= SA_NOCLDSTOP;
flags |= SA_NOCLDWAIT;
sigcld_look = 1;
}
mutex_exit(&p->p_lock);
if (sigcld_look)
return (retval);
}