xref: /titanic_51/usr/src/man/man9f/ddi_can_receive_sig.9f (revision 59596c01ca1b980a016d25670874f53e64c27ec0)
te
Copyright (c) 2003, Sun Microsystems, Inc., All Rights Reserved
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 or http://www.opensolaris.org/os/licensing. 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]
DDI_CAN_RECEIVE_SIG 9F "Dec 15, 2003"
NAME
ddi_can_receive_sig - Test for ability to receive signals
SYNOPSIS

#include <sys/ddi.h>
#include <sys/sunddi.h>



boolean_t ddi_can_receive_sig(void);
INTERFACE LEVEL

Solaris DDI specific (Solaris DDI).

PARAMETERS

None.

DESCRIPTION

The ddi_can_receive_sig() function returns a boolean value indicating whether the current thread can receive signals sent by kill(2). If the return value is B_FALSE, then the calling thread cannot receive signals, and any call to qwait_sig(9F), cv_wait_sig(9F), or cv_timedwait_sig(9F) implicitly becomes qwait(9F), cv_wait(9F), or cv_timedwait(9F), respectively. Drivers that can block indefinitely awaiting an event should use this function to determine if additional means (such as timeout(9F)) may be necessary to avoid creating unkillable threads.

RETURN VALUES
B_FALSE

The calling thread is in a state in which signals cannot be received. For example, the thread is not associated with a user process or is in the midst of exit(2) handling.

B_TRUE

The calling thread may receive a signal while blocked on a condition variable. Note that this function does not check to determine whether signals are blocked (see sigprocmask(2)).

CONTEXT

The ddi_can_receive_sig() function may be called from user, kernel, or interrupt context.

SEE ALSO

close(9E), cv_wait(9F), qwait(9F)