pthread_attr_setsigmask_np - Online Linux Manual PageSection : 3
Updated : 2023-02-05
Source : Linux man-pages 6.03
NAMEpthread_attr_setsigmask_np, pthread_attr_getsigmask_np − set/get signal mask attribute in thread attributes object
LIBRARYPOSIX threads library (libpthread, −lpthread)
SYNOPSIS#define _GNU_SOURCE /* See feature_test_macros(7) */
#include <pthread.h>int pthread_attr_setsigmask_np(pthread_attr_t *attr,
const sigset_t *sigmask);
int pthread_attr_getsigmask_np(const pthread_attr_t *attr,
sigset_t *sigmask);
DESCRIPTIONThe pthread_attr_setsigmask_np() function sets the signal mask attribute of the thread attributes object referred to by attr to the value specified in *sigmask. If sigmask is specified as NULL, then any existing signal mask attribute in attr is unset. The pthread_attr_getsigmask_np() function returns the signal mask attribute of the thread attributes object referred to by attr in the buffer pointed to by sigmask. If the signal mask attribute is currently unset, then this function returns the special value PTHREAD_ATTR_NO_SIGMASK_NP as its result.
RETURN VALUEThe pthread_attr_setsigmask_np() function returns 0 on success, or a nonzero error number on failure. the pthread_attr_getsigmask_np() function returns either 0 or PTHREAD_ATTR_NO_SIGMASK_NP. When 0 is returned, the signal mask attribute is returned via sigmask. A return value of PTHREAD_ATTR_NO_SIGMASK_NP indicates that the signal mask attribute is not set in attr. On error, these functions return a positive error number.
ERRORSENOMEM (pthread_attr_setsigmask_np()) Could not allocate memory.
VERSIONSThese functions are provided since glibc 2.32.
ATTRIBUTESFor an explanation of the terms used in this section, see attributes(7). InterfaceAttributeValue pthread_attr_setsigmask_np(), pthread_attr_getsigmask_np() Thread safetyMT-Safe
STANDARDSThese functions are nonstandard GNU extensions; hence the suffix "_np" (nonportable) in the names.
NOTESThe signal mask attribute determines the signal mask that will be assigned to a thread created using the thread attributes object attr. If this attribute is not set, then a thread created using attr will inherit a copy of the creating thread's signal mask. For more details on signal masks, see sigprocmask(2). For a description of a set of macros that can be used to manipulate and inspect signal sets, see sigsetops(3). In the absence of pthread_attr_setsigmask_np() it is possible to create a thread with a desired signal mask as follows: • The creating thread uses pthread_sigmask(3) to save its current signal mask and set its mask to block all signals. • The new thread is then created using pthread_create(); the new thread will inherit the creating thread's signal mask. • The new thread sets its signal mask to the desired value using pthread_sigmask(3). • The creating thread restores its signal mask to the original value. Following the above steps, there is no possibility for the new thread to receive a signal before it has adjusted its signal mask to the desired value.
SEE ALSOsigprocmask(2), pthread_attr_init(3), pthread_sigmask(3), pthreads(7), signal(7) 0
Johanes Gumabo
Data Size : 12,146 byte
man-pthread_attr_setsigmask_np.3Build : 2024-12-05, 20:55 :
Visitor Screen : x
Visitor Counter ( page / site ) : 3 / 182,418
Visitor ID : :
Visitor IP : 18.219.119.163 :
Visitor Provider : AMAZON-02 :
Provider Position ( lat x lon ) : 39.962500 x -83.006100 : x
Provider Accuracy Radius ( km ) : 1000 :
Provider City : Columbus :
Provider Province : Ohio , : ,
Provider Country : United States :
Provider Continent : North America :
Visitor Recorder : Version :
Visitor Recorder : Library :
Online Linux Manual Page : Version : Online Linux Manual Page - Fedora.40 - march=x86-64 - mtune=generic - 24.12.05
Online Linux Manual Page : Library : lib_c - 24.10.03 - march=x86-64 - mtune=generic - Fedora.40
Online Linux Manual Page : Library : lib_m - 24.10.03 - march=x86-64 - mtune=generic - Fedora.40
Data Base : Version : Online Linux Manual Page Database - 24.04.13 - march=x86-64 - mtune=generic - fedora-38
Data Base : Library : lib_c - 23.02.07 - march=x86-64 - mtune=generic - fedora.36
Very long time ago, I have the best tutor, Wenzel Svojanovsky . If someone knows the email address of Wenzel Svojanovsky , please send an email to johanes_gumabo@yahoo.co.id .
If error, please print screen and send to johanes_gumabo@yahoo.co.id
Under development. Support me via PayPal.