Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

[PATCH] find RLIM_NLIMITS correctly on Cygwin



On Cygwin, <sys/resource.h> has lines like:

#define RLIMIT_NLIMITS  7       /* upper bound of RLIMIT_* defines */
#define RLIM_NLIMITS    RLIMIT_NLIMITS

but rlimits.awk fails to find the value of RLIM_NLIMITS
(and sets ZSH_NLIMITS to zero).



diff --git a/Src/Builtins/rlimits.awk b/Src/Builtins/rlimits.awk
index e9c576c66..4cf960314 100644
--- a/Src/Builtins/rlimits.awk
+++ b/Src/Builtins/rlimits.awk
@@ -79,6 +79,12 @@ BEGIN {limidx = 0}
     split(limtail, tmp)
     nlimits = tmp[2]
 }
+# for Cygwin
+/^[\t ]*#[\t ]*define[\t ]*RLIM_NLIMITS[\t ]*RLIMIT_NLIMITS/ {
+    if (!nlimits && limrev["NLIMITS"]) {
+      nlimits = limrev["NLIMITS"]
+    }
+}
 
 END {
     if (limrev["MEMLOCK"] != "") {




Messages sorted by: Reverse Date, Date, Thread, Author