Download src/php/php-src/ext/pcntl/php_signal.c from meddyrat/dis-bench: direct link, hf CLI and curl.
- Browser
- Download file 2.01 kB
-
https://huggingface.co/datasets/meddyrat/dis-bench/resolve/main/src/php/php-src/ext/pcntl/php_signal.c
- Command line
-
hf download hf://datasets/meddyrat/dis-bench/src/php/php-src/ext/pcntl/php_signal.c
-
curl -L -o php_signal.c https://huggingface.co/datasets/meddyrat/dis-bench/resolve/main/src/php/php-src/ext/pcntl/php_signal.c
2.01 kB
| /* | |
| +----------------------------------------------------------------------+ | |
| | Copyright (c) The PHP Group | | |
| +----------------------------------------------------------------------+ | |
| | This source file is subject to version 3.01 of the PHP license, | | |
| | that is bundled with this package in the file LICENSE, and is | | |
| | available through the world-wide-web at the following url: | | |
| | https://www.php.net/license/3_01.txt | | |
| | If you did not receive a copy of the PHP license and are unable to | | |
| | obtain it through the world-wide-web, please send a note to | | |
| | license@php.net so we can mail you a copy immediately. | | |
| +----------------------------------------------------------------------+ | |
| | Author: Jason Greene <jason@inetgurus.net> | | |
| +----------------------------------------------------------------------+ | |
| */ | |
| /* php_signal using sigaction is derived from Advanced Programming | |
| * in the Unix Environment by W. Richard Stevens p 298. */ | |
| Sigfunc *php_signal4(int signo, Sigfunc *func, int restart, int mask_all) | |
| { | |
| struct sigaction act,oact; | |
| act.sa_sigaction = func; | |
| act.sa_handler = func; | |
| if (mask_all) { | |
| sigfillset(&act.sa_mask); | |
| } else { | |
| sigemptyset(&act.sa_mask); | |
| } | |
| act.sa_flags = SA_ONSTACK; | |
| act.sa_flags |= SA_SIGINFO; | |
| if (!restart) { | |
| act.sa_flags |= SA_INTERRUPT; /* SunOS */ | |
| } else { | |
| act.sa_flags |= SA_RESTART; /* SVR4, 4.3+BSD */ | |
| } | |
| zend_sigaction(signo, &act, &oact); | |
| return oact.sa_sigaction; | |
| return oact.sa_handler; | |
| } | |
| Sigfunc *php_signal(int signo, Sigfunc *func, int restart) | |
| { | |
| return php_signal4(signo, func, restart, 0); | |
| } | |