xref: /illumos-gate/usr/src/man/man3c_db/td_thr_setsigpending.3c_db (revision 1fa2a66491e7d8ae0be84e7da4da8e812480c710)
te
Copyright (c) 1998 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]
TD_THR_SETSIGPENDING 3C_DB "September 12, 2020"
NAME
td_thr_setsigpending, td_thr_sigsetmask - manage thread signals for libc_db
SYNOPSIS
cc [ flag... ] file... -lc_db [ library... ]
#include <proc_service.h>
#include <thread_db.h>

td_err_e td_thr_setsigpending(const td_thrhandle_t * th_p, const uchar_t ti_sigpending_flag,
 const sigset_t ti_sigmask);

td_err_e td_thr_sigsetmask(const td_thrhandle_t *th_p, const sigset_t ti_sigmask);
DESCRIPTION
The td_thr_setsigpending() and td_thr_setsigmask() functions affect the signal state of the thread identified by th_p.

The td_thr_setsigpending() function sets the set of pending signals for thread th_p to ti_sigpending. The value of the libc-internal field that indicates whether a thread has any signal pending is set to ti_sigpending_flag. To be consistent, ti_sigpending_flag should be 0 if and only if all of the bits in ti_sigpending are 0.

The td_thr_sigsetmask() function sets the signal mask of the thread th_p as if the thread had set its own signal mask with thr_sigsetmask(3C). The new signal mask is the value of ti_sigmask.

There is no equivalent to the SIG_BLOCK or SIG_UNBLOCK operations of thr_sigsetmask(3C), which mask or unmask specific signals without affecting the mask state of other signals. To block or unblock specific signals,

1. stop either the entire process or the thread with td_thr_dbsuspend(),

2. determine the thread's existing signal mask by calling td_thr_get_info(3C_DB),

3. modify the ti_sigmask member of the td_thrinfo_t structure as desired, and

4. set the new signal mask with td_thr_sigsetmask().

RETURN VALUES
TD_OK

The call completed successfully.

TD_BADTH

An invalid thread handle was passed in.

TD_DBERR

A call to one of the imported interface routines failed.

TD_ERR

A libc_db internal error occurred.

ATTRIBUTES
See attributes(5) for description of the following attributes:
ATTRIBUTE TYPE ATTRIBUTE VALUE
MT-Level Safe
SEE ALSO
libc_db(3LIB), td_thr_dbsuspend(3C_DB), td_thr_get_info(3C_DB), attributes(5)