From: Edin Kadribasic Date: Tue, 4 Jun 2002 15:51:25 +0000 (+0000) Subject: Added function pcntl_alarm(). X-Git-Tag: RELEASE_0_90~33 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=3b3ec06ee7a9c31508377a618dd2f51f40cfa512;p=php Added function pcntl_alarm(). @- Added pctnl_alarm() function. (Edin) --- diff --git a/ext/pcntl/pcntl.c b/ext/pcntl/pcntl.c index 8f48cbb578..2af78df9fa 100755 --- a/ext/pcntl/pcntl.c +++ b/ext/pcntl/pcntl.c @@ -51,6 +51,7 @@ function_entry pcntl_functions[] = { PHP_FE(pcntl_wtermsig, NULL) PHP_FE(pcntl_wstopsig, NULL) PHP_FE(pcntl_exec, NULL) + PHP_FE(pcntl_alarm, NULL) {NULL, NULL, NULL} }; @@ -216,6 +217,19 @@ PHP_FUNCTION(pcntl_fork) } /* }}} */ +/* {{{ proto int pcntl_alarm(int seconds) + Set an alarm clock for delivery of a signal*/ +PHP_FUNCTION(pcntl_alarm) +{ + long seconds; + + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &seconds) == FAILURE) + return; + + RETURN_LONG ((long) alarm(seconds)); +} +/* }}} */ + /* {{{ proto int pcntl_waitpid(long pid, long status, long options) Waits on or returns the status of a forked child as defined by the waitpid() system call */ PHP_FUNCTION(pcntl_waitpid) diff --git a/ext/pcntl/php_pcntl.h b/ext/pcntl/php_pcntl.h index c555cb5441..f06cbcddf2 100644 --- a/ext/pcntl/php_pcntl.h +++ b/ext/pcntl/php_pcntl.h @@ -39,6 +39,7 @@ PHP_RINIT_FUNCTION(pcntl); PHP_RSHUTDOWN_FUNCTION(pcntl); PHP_MINFO_FUNCTION(pcntl); +PHP_FUNCTION(pcntl_alarm); PHP_FUNCTION(pcntl_fork); PHP_FUNCTION(pcntl_waitpid); PHP_FUNCTION(pcntl_wifexited);