sigtimedwait.c revision 3348528f7ec68bf2f11d0cbd5c3b9932ea7f0d5c
/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License, Version 1.0 only
* (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 2005 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>
#include <sys/condvar_impl.h>
static int
{
if (datamodel == DATAMODEL_NATIVE) {
} else {
}
}
#ifdef _SYSCALL32_IMPL
else {
}
}
#endif
}
/*
* Wait until a signal within a specified set is posted or until the
* time interval 'timeout' if specified. The signal is caught but
* not delivered. The value of the signal is returned to the caller.
*/
int
{
int timecheck = 0;
int ret;
int error = 0;
if (timeoutp) {
gethrestime(&now);
if (datamodel == DATAMODEL_NATIVE) {
sizeof (sig_timeout)))
} else {
}
if (itimerspecfix(&sig_timeout))
/*
* Convert the timespec value into absolute time.
*/
rqtp = &sig_timeout;
}
if (sigisempty(&kset))
mutex_enter(&p->p_lock);
/*
* set the thread's signal mask to unmask
* those signals in the specified set.
*/
/*
* Wait until we take a signal or until
* the absolute future time is passed.
*/
continue;
if (ret == -1)
/*
* Restore thread's signal mask to its previous value.
*/
if (error) {
mutex_exit(&p->p_lock);
}
/*
* Don't bother with signal if it is not in request set.
*/
mutex_exit(&p->p_lock);
/*
* lwp_cursig is zero if pokelwps() awakened cv_wait_sig().
* This happens if some other thread in this process called
* forkall() or exit().
*/
}
if (lwp->lwp_curinfo)
else {
}
lwp->lwp_cursig = 0;
lwp->lwp_extsig = 0;
mutex_exit(&p->p_lock);
if (siginfop)
if (lwp->lwp_curinfo) {
}
return (ret);
}