Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

pcntl_sigprocmask(3) [php man page]

PCNTL_SIGPROCMASK(3)							 1						      PCNTL_SIGPROCMASK(3)

pcntl_sigprocmask - Sets and retrieves blocked signals

SYNOPSIS
bool pcntl_sigprocmask (int $how, array $set, [array &$oldset]) DESCRIPTION
The pcntl_sigprocmask(3) function adds, removes or sets blocked signals, depending on the $how parameter. PARAMETERS
o $how - Sets the behavior of pcntl_sigprocmask(3). Possible values: o SIG_BLOCK: Add the signals to the currently blocked signals. o SIG_UNBLOCK: Remove the signals from the currently blocked signals. o SIG_SETMASK: Replace the currently blocked signals by the given list of signals. o $set - List of signals. o $oldset - The $oldset parameter is set to an array containing the list of the previously blocked signals. RETURN VALUES
Returns TRUE on success or FALSE on failure. EXAMPLES
Example #1 pcntl_sigprocmask(3) example <?php pcntl_sigprocmask(SIG_BLOCK, array(SIGHUP)); $oldset = array(); pcntl_sigprocmask(SIG_UNBLOCK, array(SIGHUP), $oldset); ?> SEE ALSO
pcntl_sigwaitinfo(3), pcntl_sigtimedwait(3). PHP Documentation Group PCNTL_SIGPROCMASK(3)

Check Out this Related Man Page

SIGPROCMASK(2)						     Linux Programmer's Manual						    SIGPROCMASK(2)

NAME
sigprocmask - examine and change blocked signals SYNOPSIS
#include <signal.h> int sigprocmask(int how, const sigset_t *set, sigset_t *oldset); Feature Test Macro Requirements for glibc (see feature_test_macros(7)): sigprocmask(): _POSIX_C_SOURCE >= 1 || _XOPEN_SOURCE || _POSIX_SOURCE DESCRIPTION
sigprocmask() is used to fetch and/or change the signal mask of the calling thread. The signal mask is the set of signals whose delivery is currently blocked for the caller (see also signal(7) for more details). The behavior of the call is dependent on the value of how, as follows. SIG_BLOCK The set of blocked signals is the union of the current set and the set argument. SIG_UNBLOCK The signals in set are removed from the current set of blocked signals. It is permissible to attempt to unblock a signal which is not blocked. SIG_SETMASK The set of blocked signals is set to the argument set. If oldset is non-NULL, the previous value of the signal mask is stored in oldset. If set is NULL, then the signal mask is unchanged (i.e., how is ignored), but the current value of the signal mask is nevertheless returned in oldset (if it is not NULL). The use of sigprocmask() is unspecified in a multithreaded process; see pthread_sigmask(3). RETURN VALUE
sigprocmask() returns 0 on success and -1 on error. ERRORS
EINVAL The value specified in how was invalid. CONFORMING TO
POSIX.1-2001. NOTES
It is not possible to block SIGKILL or SIGSTOP. Attempts to do so are silently ignored. Each of the threads in a process has its own signal mask. A child created via fork(2) inherits a copy of its parent's signal mask; the signal mask is preserved across execve(2). If SIGBUS, SIGFPE, SIGILL, or SIGSEGV are generated while they are blocked, the result is undefined, unless the signal was generated by kill(2), sigqueue(2), or raise(3). See sigsetops(3) for details on manipulating signal sets. SEE ALSO
kill(2), pause(2), sigaction(2), signal(2), sigpending(2), sigqueue(2), sigsuspend(2), pthread_sigmask(3), sigsetops(3), signal(7) COLOPHON
This page is part of release 3.25 of the Linux man-pages project. A description of the project, and information about reporting bugs, can be found at http://www.kernel.org/doc/man-pages/. Linux 2008-10-17 SIGPROCMASK(2)
Man Page

13 More Discussions You Might Find Interesting

1. Programming

Function in a blocked state.

Hi, How do you write a function which has to stay blocked in a wait state till an event occurs? The event could be the arrival of a message/updation of a database etc .. Regards, VJ (2 Replies)
Discussion started by: vjsony
2 Replies

2. Programming

keypress signals

How-to use keypress action signals in C? Is there any nice select or poll functions for that? (1 Reply)
Discussion started by: Esaia
1 Replies

3. IP Networking

School Blocking

I'm in highschool. They blocked my favorite site. How do I disable websense without getting caught on that particular webpage? Is it even possible? *twitch* I would also like to get as much UNIX for beginners information, so if someone might point me in the right direction so I don't have to read... (1 Reply)
Discussion started by: Satine
1 Replies

4. Programming

Problem with signals - 3 process communication

Hello, I would like to ask you for a little help with program I'm working on. I have problems with signals and synchronizing processes (I'm quite new to this part of programming). Process "parent" creates new child process "child1" and this process creates new child process "child2". The... (2 Replies)
Discussion started by: Nightwright
2 Replies

5. Programming

positioning cursor

I am using curses.h and signals.h to control output to screen. My code displays an unchanging prompt that waits for user input. Meanwhile alarm signals are being generated that cause other ancillary messages to appear at other locations on the screen at various times. The problem I have is with... (2 Replies)
Discussion started by: enuenu
2 Replies

6. UNIX for Advanced & Expert Users

Process signals as administration

Too generic to post elsewhere, too advanced for the newbie forums. There are some applications within the unix/linux milieu that understand signals such as SIGHUP, etc as instructions to perform administrative tasks (clearing information out of this, disconnect users, etc.) I was just wondering if... (2 Replies)
Discussion started by: thmnetwork
2 Replies

7. Programming

add more user-defined signals

Hi Is there a way to add more user-defined signals? I am currently using SIGUSR1 and SIGUSR2 - but I need another one. How can I do that? Thanks! (9 Replies)
Discussion started by: naamabm
9 Replies

8. UNIX for Advanced & Expert Users

Date on which a user is blocked

I work on AIX 5.3 and need to know if is possible to know the date on which a user is blocked. Thank you. (1 Reply)
Discussion started by: cmr88
1 Replies

9. UNIX for Dummies Questions & Answers

perror with signals

I have following problem with this code.. First time trough the main loop..... perror gives ....blocked signal:success(all other times gives illlegal seek) Should every time trought the main loop be success?? And the perror otside of main loop...didn't change mask:success That line of code... (2 Replies)
Discussion started by: joker40
2 Replies

10. UNIX for Advanced & Expert Users

Convert variable blocked file

Dear All, I am receiving Fixed blocked file from AS/400 system to my unix box. Could you please advise us how to convert this fix blocked file to variable blocked file. Do we have any command in Unixt or program. I am new to this Unix system Thanks & Regards, Colam (1 Reply)
Discussion started by: coolmaninit
1 Replies

11. UNIX for Dummies Questions & Answers

Do UNIX signals produce interrupts?

Hi folks! I have been reading Vahalia's Unix Internals book, which states the following in the chapter dedicated to signals: Given that, my understanding is that processes running in user mode don't become aware of signals until they switch to kernel mode, where the issig() function is called... (3 Replies)
Discussion started by: Tru69
3 Replies

12. Solaris

How to find blocked process in vmstat?

Hi, How to find which processes are blocked? b column in vmstat shows higher values some times(approximately 30 min) bash-3.2# vmstat 1 10 kthr memory page disk faults cpu r b w swap free re mf pi po fr de sr m1 m1 m1 m2 in sy cs us... (3 Replies)
Discussion started by: sureshsun
3 Replies

13. Shell Programming and Scripting

Parse the longest matching string

Hello experts, I am trying to unscramble a mixed signal into component signals. Let the list of known signals be $ cat tmplist DU DU4016 GFF GFF2010 GFF201019 G2115 G211 DU40 (1 Reply)
Discussion started by: senhia83
1 Replies