PCNTL_SIGNAL_DISPATCH(3) 1 PCNTL_SIGNAL_DISPATCH(3)pcntl_signal_dispatch - Calls signal handlers for pending signalsSYNOPSIS
bool pcntl_signal_dispatch (void )
DESCRIPTION
The pcntl_signal_dispatch(3) function calls the signal handlers installed by pcntl_signal(3) for each pending signal.
RETURN VALUES
Returns TRUE on success or FALSE on failure.
EXAMPLES
Example #1
pcntl_signal_dispatch(3) example
<?php
echo "Installing signal handler...
";
pcntl_signal(SIGHUP, function($signo) {
echo "signal handler called
";
});
echo "Generating signal SIGHUP to self...
";
posix_kill(posix_getpid(), SIGHUP);
echo "Dispatching...
";
pcntl_signal_dispatch();
echo "Done
";
?>
The above example will output something similar to:
Installing signal handler...
Generating signal SIGHUP to self...
Dispatching...
signal handler called
Done
SEE ALSO pcntl_signal(3), pcntl_sigprocmask(3), pcntl_sigwaitinfo(3), pcntl_sigtimedwait(3).
PHP Documentation Group PCNTL_SIGNAL_DISPATCH(3)
Check Out this Related Man Page
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)
Hi All,
I am a newbbie at UNIX/LINUX and recently installed GD library and all the jpeg6b and libpng successfuly. I have also added the extension=gd.so in the php.ini file under "Dynamic Extensions"
The issue I am having now is enabling GD library. I am suppose to now add a few lines to the... (3 Replies)
Hey guys,
I am trying to write a little shell, and was writing a signal handler to handle SIGINT (I am using 'stty intr ^C' and using ctrl-C to give SIGINT).
I wrote this signal handler: void handle_sigint()
{
write(2,"handling sigint\n",16);
write(1,"\nshell% ",8);
}
... (4 Replies)
hi
i have a variable called vara="(" i need to use this in a if condition like this..
vara="("
echo "$vara"
if
then
echo "yes"
else
echo "no"
fi
but this does not work andgives me the error
test: argument expected
any solution for this? (5 Replies)
I use FreeBSD,and use signal,like follows:
signal(SIGHUP,sig_hup);
signal(SIGIO,sig_io);
when I run call following code,it can run,but I find a puzzled question,it should print some information,such as printf("execute main()") will print execute main(),but in fact,printf fuction print... (2 Replies)
I compile following statement
signal(SIGHUP,sig_hup);
kill(getpid(),SIGTSTP);
$gcc test.c
it raise following error:
error:'SIGHUP' undeclared (first use in this function)
error:'SIGTSTP' undeclared (first use in this function)
Why raise above error? which head file include... (1 Reply)
Hi,
I have a file which is having some contents, in that I want to grep for 3 particular patterns. If all the 3 patterns are present then I like to echo success else echo failure. Could you please help me how we can do this unix script.
Thanks, (1 Reply)
Hello,
I'm writing some serial(UART) handler but have stuck on few issues, maybe anyone can help to show me what I'm doing wrong.
Basically I'm intending to write serial RX signal handler.
Application receives defined packages of data over serial which contains header and payload. Handler... (3 Replies)