PCNTL_SIGPROCMASK(3) 1 PCNTL_SIGPROCMASK(3)pcntl_sigprocmask - Sets and retrieves blocked signalsSYNOPSIS
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
PCNTL_SIGWAITINFO(3) 1 PCNTL_SIGWAITINFO(3)pcntl_sigwaitinfo - Waits for signalsSYNOPSIS
int pcntl_sigwaitinfo (array $set, [array &$siginfo])
DESCRIPTION
The pcntl_sigwaitinfo(3) function suspends execution of the calling script until one of the signals given in $set are delivered. If one of
the signal is already pending (e.g. blocked by pcntl_sigprocmask(3)), pcntl_sigwaitinfo(3) will return immediately.
PARAMETERS
o $set
- Array of signals to wait for.
o $siginfo
- The $siginfo parameter is set to an array containing informations about the signal. The following elements are set for all sig-
nals:
osigno: Signal number
oerrno: An error number
ocode: Signal code
The following elements may be set for the SIGCHLD signal:
ostatus: Exit value or signal
outime: User time consumed
ostime: System time consumed
opid: Sending process ID
ouid: Real user ID of sending process
The following elements may be set for the SIGILL, SIGFPE, SIGSEGV and SIGBUS signals:
oaddr: Memory location which caused fault
The following element may be set for the SIGPOLL signal:
oband: Band event
ofd: File descriptor number
RETURN VALUES
On success, pcntl_sigwaitinfo(3) returns a signal number.
EXAMPLES
Example #1
pcntl_sigwaitinfo(3) example
<?php
echo "Blocking SIGHUP signal
";
pcntl_sigprocmask(SIG_BLOCK, array(SIGHUP));
echo "Sending SIGHUP to self
";
posix_kill(posix_getpid(), SIGHUP);
echo "Waiting for signals
";
$info = array();
pcntl_sigwaitinfo(array(SIGHUP), $info);
?>
SEE ALSO pcntl_sigprocmask(3), pcntl_sigtimedwait(3).
PHP Documentation Group PCNTL_SIGWAITINFO(3)
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)
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)
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)
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)
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)
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)
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)
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)
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)
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)
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)