PTHREAD_SIGMASK(3) BSD Library Functions Manual PTHREAD_SIGMASK(3)NAME
pthread_sigmask -- examine and/or change a thread's signal mask
LIBRARY
POSIX Threads Library (libpthread, -lpthread)
SYNOPSIS
#include <pthread.h>
#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
The pthread_sigmask() function will fail if:
[EINVAL] how is not one of the defined values.
SEE ALSO sigaction(2), sigpending(2), sigprocmask(2), sigsuspend(2), sigsetops(3)STANDARDS
The pthread_sigmask() function conforms to ISO/IEC 9945-1:1996 (``POSIX.1'')
BSD February 19, 2011 BSD
Check Out this Related Man Page
SIGPROCMASK(2) BSD System Calls Manual SIGPROCMASK(2)NAME
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
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)
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)
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)
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)
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)
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)
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)