Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

pcntl_signal_dispatch(3) [php man page]

PCNTL_SIGNAL_DISPATCH(3)						 1						  PCNTL_SIGNAL_DISPATCH(3)

pcntl_signal_dispatch - Calls signal handlers for pending signals

SYNOPSIS
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 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)
Man Page

12 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Installing GUI

(1 Reply)
Discussion started by: koraykazgan
1 Replies

2. UNIX for Dummies Questions & Answers

Help, Installing GD Library and Enabling.

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)
Discussion started by: peachesboy
3 Replies

3. Programming

signal handler problems

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)
Discussion started by: blowtorch
4 Replies

4. UNIX for Dummies Questions & Answers

how to do this........... is it possible ???

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)
Discussion started by: Syms
5 Replies

5. Linux

Installing Linux on an existing Windows PC?

(4 Replies)
Discussion started by: Methal
4 Replies

6. Programming

why printf() function don't go work?

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)
Discussion started by: konvalo
2 Replies

7. Programming

'SIGHUP','SIGTSTP' undeclared

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)
Discussion started by: konvalo
1 Replies

8. UNIX for Dummies Questions & Answers

Need help in scripting

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)
Discussion started by: senor.ram
1 Replies

9. Programming

problem in doing coding of signal handler

i m unble to execute code of signal handler using a) Wait b) Waitpid (1 Reply)
Discussion started by: madhura
1 Replies

10. Shell Programming and Scripting

Case signal

Task 1: #!/bin/ksh if then echo "Usage : $0 Signalnumber PID" exit fi case "$1" in 1) echo "Sending SIGHUP signal" kill -SIGHUP $2 ;; 2) echo "Sending SIGINT signal" kill -SIGINT $2 ;; 3) echo "Sending SIGQUIT signal" kill -SIGQUIT $2 (3 Replies)
Discussion started by: Ramesh M
3 Replies

11. Programming

Serial port signal(IRQ) handler (using C)

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)
Discussion started by: Lauris_k
3 Replies

12. UNIX for Dummies Questions & Answers

Installing winpcap and configure it with cygwin

(6 Replies)
Discussion started by: steve120
6 Replies