Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

pthread_sigmask(2) [osx man page]

PTHREAD_SIGMASK(2)					      BSD System Calls Manual						PTHREAD_SIGMASK(2)

pthread_sigmask -- examine and/or change a thread's signal mask SYNOPSIS
#include <signal.h> int pthread_sigmask(int how, const sigset_t *restrict set, sigset_t *restrict oset); DESCRIPTION
The pthread_sigmask() function examines and/or changes the calling thread's signal mask. If set is not NULL, it specifies a set of signals to be modified, and how specifies what to set the signal mask to: SIG_BLOCK Union of the current mask and set. SIG_UNBLOCK Intersection of the current mask and the complement of set. SIG_SETMASK set. If oset is not NULL, the previous signal mask is stored in the location pointed to by oset. SIGKILL and SIGSTOP cannot be blocked, and will be silently ignored if included in the signal mask. RETURN VALUES
If successful, pthread_sigmask() returns 0. Otherwise, an error is returned. ERRORS
pthread_sigmask() will fail if: [EINVAL] how is not one of the defined values. LEGACY SYNOPSIS
#include <pthread.h> #include <signal.h> The include file <pthread.h> is necessary. SEE ALSO
sigaction(2), sigpending(2), sigprocmask(2), sigsuspend(2), sigsetops(3), compat(5) STANDARDS
pthread_sigmask() conforms to ISO/IEC 9945-1:1996 (``POSIX.1'') BSD
April 27, 2000 BSD

Check Out this Related Man Page

SIGPROCMASK(2)						      BSD System Calls Manual						    SIGPROCMASK(2)

sigprocmask -- manipulate current signal mask LIBRARY
Standard C Library (libc, -lc) SYNOPSIS
#include <signal.h> int sigprocmask(int how, const sigset_t * restrict set, sigset_t * restrict oset); DESCRIPTION
The sigprocmask() system call examines and/or changes the current signal mask (those signals that are blocked from delivery). Signals are blocked if they are members of the current signal mask set. If set is not null, the action of sigprocmask() depends on the value of the how argument. The signal mask is changed as a function of the specified set and the current mask. The function is specified by how using one of the following values from <signal.h>: SIG_BLOCK The new mask is the union of the current mask and the specified set. SIG_UNBLOCK The new mask is the intersection of the current mask and the complement of the specified set. SIG_SETMASK The current mask is replaced by the specified set. If oset is not null, it is set to the previous value of the signal mask. When set is null, the value of how is insignificant and the mask remains unset providing a way to examine the signal mask without modification. The system quietly disallows SIGKILL or SIGSTOP to be blocked. In threaded applications, pthread_sigmask(3) must be used instead of sigprocmask(). RETURN VALUES
The sigprocmask() function returns the value 0 if successful; otherwise the value -1 is returned and the global variable errno is set to indicate the error. ERRORS
The sigprocmask() system call will fail and the signal mask will be unchanged if one of the following occurs: [EINVAL] The how argument has a value other than those listed here. SEE ALSO
kill(2), sigaction(2), sigpending(2), sigsuspend(2), fpsetmask(3), pthread_sigmask(3), sigsetops(3) STANDARDS
The sigprocmask() system call is expected to conform to ISO/IEC 9945-1:1990 (``POSIX.1''). BSD
May 7, 2010 BSD
Man Page

8 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

Round Robin Scheduling

Hi, first post. Well, here goes: Ok, so I need to build a round robin scheduling algorithm. I understand HOW the algorithm works and I can write it down/show you on paper if you were to ask me "how does the RR scheduling algorithm work?" Only problem is that I'm having a hell of a time... (0 Replies)
Discussion started by: ramoneguru
0 Replies

2. Programming

What is the difference between f(...), f(void) and f()

What is the difference between f(...) , f(void),f() I know that f(void) doesn't take any parameters, but what about f() and f(...) Does the last call of function even exists? (2 Replies)
Discussion started by: purplelightspar
2 Replies

3. UNIX for Advanced & Expert Users

capturing synchronous signals

hi, i created 2 threads in which one thread is dedicated to capture signals and handle them. i used the following functions: sigfillset for filling the signal set to be blocked by other threads sigwait for waiting on particular signals pthread_sigmask to mask block the signals. I... (0 Replies)
Discussion started by: skyrulz
0 Replies

4. Programming

why multiple SIGINT raises when i hit C-c

hi, in my application, i have set up to capture SIGINT and execute a handler.the problem is whenever i hit C-c, multiple SIGINT are sent to the application.I have blocked the SIGINT right after catching the first one but it is unsuccessful.Here is what i do : jmp_buf main_loop; int... (1 Reply)
Discussion started by: Sedighzadeh
1 Replies

5. Programming

SIGCHLD interrupts its own handler

Hi. I have a program whose job it is to manage 15 child processes. Sometimes these children die (sometimes deliberately other times with a SEGV). This causes a SIGCHLD to be sent to my program which uses waitpid() in the signal handler to gather information and, in most cases, restart the child.... (3 Replies)
Discussion started by: jrichemont
3 Replies

6. Programming

Unable to create a UDP client from thread?

I try to initial a UDP client from threading, but it doesn't work? why? These codes from the textbook #define ECHOMAX 255 /* Longest string to echo */ #define TIMEOUT_SECS 2 /* Seconds between retransmits */ #define MAXTRIES 5 /* Tries before giving up */... (3 Replies)
Discussion started by: sehang
3 Replies

7. Programming

Thread parameter in ANSI C makes a segmentation fault

The creation of thread. void Client_Constructor ( const char* IPAddr ) { pthread_t tid; pthread_attr_t rx; /* Create separate memory for client argument */ struct ThreadArgs *threadArgs; if ( ( threadArgs = ( struct ThreadArgs* ) malloc( sizeof( struct ThreadArgs )... (14 Replies)
Discussion started by: sehang
14 Replies

8. Programming

Losing signal problem

I'm newbie in UNIX programming, I have a problem with signals. I'm writing multithread program, where threads can die at any moment. When thread dies it generates signal SIGUSR1 to main thread and then thread dies. Main thread gets a signal and waits for thread dead. I wrote program like this: ... (5 Replies)
Discussion started by: DendyGamer
5 Replies