com php-src: extend _SC_ARG_MAX usage onto platform s where it's available: ext/standard/exec.c
| From: | Stanislav Malyshev | Date: | Thu, 28 Jan 2016 11:06:33 +0000 |
| Subject: | com php-src: extend _SC_ARG_MAX usage onto platform s where it's available: ext/standard/exec.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-90878@lists.php.net to get a copy of this message | ||
Commit: a9048d101fe7bfe3f64788829f4e7e1cc8f55f46
Author: Anatol Belski <ab@php.net> Thu, 28 Jan 2016 12:06:33 +0100
Parents: c527549e899bf211aac7d8ab5ceb1bdfedf07f14
Branches: PHP-7.0 PHP-7.0.3 master
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=a9048d101fe7bfe3f64788829f4e7e1cc8f55f46
Log:
extend _SC_ARG_MAX usage onto platforms where it's available
Changed paths:
M ext/standard/exec.c
Diff:
diff --git a/ext/standard/exec.c b/ext/standard/exec.c
index 29024f6..cbaaedb 100644
--- a/ext/standard/exec.c
+++ b/ext/standard/exec.c
@@ -46,7 +46,7 @@
#include <fcntl.h>
#endif
-#if (HAVE_NICE || defined(__linux__)) && HAVE_UNISTD_H
+#if HAVE_UNISTD_H
#include <unistd.h>
#endif
@@ -55,7 +55,7 @@ static int cmd_max_len;
/* {{{ PHP_MINIT_FUNCTION(exec) */
PHP_MINIT_FUNCTION(exec)
{
-#ifdef __linux__
+#ifdef _SC_ARG_MAX
cmd_max_len = sysconf(_SC_ARG_MAX);
#elif defined(ARG_MAX)
cmd_max_len = ARG_MAX;