com php-src: Add wifcontinued and wcontinued for pcntl: ext/pcntl/pcntl.c ext/pcntl/php_pcntl.h
| From: | JulienPauli | Date: | Tue, 17 Mar 2015 09:59:58 +0000 |
| Subject: | com php-src: Add wifcontinued and wcontinued for pcntl: ext/pcntl/pcntl.c ext/pcntl/php_pcntl.h | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-85550@lists.php.net to get a copy of this message | ||
Commit: 90114a3e93f5209b3d880d154fdb61d3d0c67185
Author: julien.pons <julien.pons@mobpartner.com> Mon, 23 Feb 2015 14:38:55 +0100
Committer: Julien Pauli <jpauli@php.net> Tue, 17 Mar 2015 10:59:58 +0100
Parents: 56b0ff0e5d125f8fc83658b9ac2faec0f45e93c6
Branches: master
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=90114a3e93f5209b3d880d154fdb61d3d0c67185
Log:
Add wifcontinued and wcontinued for pcntl
Changed paths:
M ext/pcntl/pcntl.c
M ext/pcntl/php_pcntl.h
Diff:
diff --git a/ext/pcntl/pcntl.c b/ext/pcntl/pcntl.c
index 7d130ae..8cb2617 100644
--- a/ext/pcntl/pcntl.c
+++ b/ext/pcntl/pcntl.c
@@ -96,6 +96,12 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_pcntl_wifstopped, 0, 0, 1)
ZEND_ARG_INFO(0, status)
ZEND_END_ARG_INFO()
+#ifdef HAVE_WCONTINUED
+ZEND_BEGIN_ARG_INFO_EX(arginfo_pcntl_wifcontinued, 0, 0, 1)
+ ZEND_ARG_INFO(0, status)
+ZEND_END_ARG_INFO()
+#endif
+
ZEND_BEGIN_ARG_INFO_EX(arginfo_pcntl_wifsignaled, 0, 0, 1)
ZEND_ARG_INFO(0, status)
ZEND_END_ARG_INFO()
@@ -158,7 +164,7 @@ const zend_function_entry pcntl_functions[] = {
PHP_FE(pcntl_alarm, arginfo_pcntl_alarm)
PHP_FE(pcntl_get_last_error, arginfo_pcntl_void)
PHP_FALIAS(pcntl_errno, pcntl_get_last_error, NULL)
- PHP_FE(pcntl_strerror, arginfo_pcntl_strerror)
+ PHP_FE(pcntl_strerror, arginfo_pcntl_strerror)
#ifdef HAVE_GETPRIORITY
PHP_FE(pcntl_getpriority, arginfo_pcntl_getpriority)
#endif
@@ -172,6 +178,9 @@ const zend_function_entry pcntl_functions[] = {
PHP_FE(pcntl_sigwaitinfo, arginfo_pcntl_sigwaitinfo)
PHP_FE(pcntl_sigtimedwait, arginfo_pcntl_sigtimedwait)
#endif
+#ifdef HAVE_WCONTINUED
+ PHP_FE(pcntl_wifcontinued, arginfo_pcntl_wifcontinued)
+#endif
PHP_FE_END
};
@@ -209,6 +218,9 @@ void php_register_signal_constants(INIT_FUNC_ARGS)
#ifdef WUNTRACED
REGISTER_LONG_CONSTANT("WUNTRACED", (zend_long) WUNTRACED, CONST_CS |
CONST_PERSISTENT);
#endif
+#ifdef HAVE_WCONTINUED
+ REGISTER_LONG_CONSTANT("WCONTINUED", (zend_long) WCONTINUED, CONST_CS |
CONST_PERSISTENT);
+#endif
/* Signal Constants */
REGISTER_LONG_CONSTANT("SIG_IGN", (zend_long) SIG_IGN, CONST_CS | CONST_PERSISTENT);
@@ -681,6 +693,24 @@ PHP_FUNCTION(pcntl_wifsignaled)
RETURN_FALSE;
}
/* }}} */
+/* {{{ proto bool pcntl_wifcontinued(int status)
+ Returns true if the child status code represents a process that was resumed due to a SIGCONT
signal */
+PHP_FUNCTION(pcntl_wifcontinued)
+{
+#ifdef HAVE_WCONTINUED
+ zend_long status_word;
+
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "l", &status_word) == FAILURE) {
+ return;
+ }
+
+ if (WIFCONTINUED(status_word))
+ RETURN_TRUE;
+#endif
+ RETURN_FALSE;
+}
+/* }}} */
+
/* {{{ proto int pcntl_wexitstatus(int status)
Returns the status code of a child's exit */
diff --git a/ext/pcntl/php_pcntl.h b/ext/pcntl/php_pcntl.h
index d40ee12..b9af84b 100644
--- a/ext/pcntl/php_pcntl.h
+++ b/ext/pcntl/php_pcntl.h
@@ -21,6 +21,8 @@
#ifndef PHP_PCNTL_H
#define PHP_PCNTL_H
+#define HAVE_WCONTINUED defined(WCONTINUED) && defined (WIFCONTINUED)
+
extern zend_module_entry pcntl_module_entry;
#define phpext_pcntl_ptr &pcntl_module_entry
@@ -37,6 +39,9 @@ PHP_FUNCTION(pcntl_wait);
PHP_FUNCTION(pcntl_wifexited);
PHP_FUNCTION(pcntl_wifstopped);
PHP_FUNCTION(pcntl_wifsignaled);
+#ifdef HAVE_WCONTINUED
+PHP_FUNCTION(pcntl_wifcontinued);
+#endif
PHP_FUNCTION(pcntl_wexitstatus);
PHP_FUNCTION(pcntl_wtermsig);
PHP_FUNCTION(pcntl_wstopsig);