php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Return to Bug #72678
Patch php-7.0.9-aix-setrlimit.patch revision 2016-07-26 13:41 UTC by matthieu dot sarter dot external at atos dot net

Patch php-7.0.9-aix-setrlimit.patch for POSIX related Bug #72678

Patch version 2016-07-26 13:41 UTC

Return to Bug #72678 | Download this patch
Patch Revisions:

Developer: matthieu.sarter.external@atos.net

diff -Nur php-7.0.3.orig/ext/posix/posix.c php-7.0.3-aix/ext/posix/posix.c
--- php-7.0.3.orig/ext/posix/posix.c	2016-02-02 17:32:31 +0100
+++ php-7.0.3-aix/ext/posix/posix.c	2016-03-10 17:18:19 +0100
@@ -1395,6 +1395,18 @@
 		RETURN_FALSE;
 	}
 
+#if defined(_AIX)
+	/*
+	On AIX, when cur > max setrlimit returns 0 and sets softlimit and hardlimit to max,
+	instead of returning -1, so we need to check the values to reproduce the same behavior
+	as setrlimit on Linux.
+	*/
+	if (cur > max) {
+		POSIX_G(last_error) = EINVAL;
+		RETURN_FALSE;
+	}
+#endif
+
 	rl.rlim_cur = cur;
 	rl.rlim_max = max;
 

 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Apr 19 16:01:27 2024 UTC