summaryrefslogtreecommitdiff
path: root/ext/pcntl/pcntl.c
diff options
context:
space:
mode:
authorEdin Kadribasic <edink@php.net>2002-06-04 15:51:25 +0000
committerEdin Kadribasic <edink@php.net>2002-06-04 15:51:25 +0000
commit3b3ec06ee7a9c31508377a618dd2f51f40cfa512 (patch)
tree0a2127d0ef76551d5df82d87b19c40b2095ad670 /ext/pcntl/pcntl.c
parent4317a5c7a99641730a24b1207346d57e08394cb8 (diff)
downloadphp-git-3b3ec06ee7a9c31508377a618dd2f51f40cfa512.tar.gz
Added function pcntl_alarm().
@- Added pctnl_alarm() function. (Edin)
Diffstat (limited to 'ext/pcntl/pcntl.c')
-rwxr-xr-xext/pcntl/pcntl.c14
1 files changed, 14 insertions, 0 deletions
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)