zsh-workers
 help / color / mirror / code / Atom feed
* [PATCH] support RLIMIT_UMTXP on FreeBSD
@ 2019-08-26  9:18 Jun T
  0 siblings, 0 replies; only message in thread
From: Jun T @ 2019-08-26  9:18 UTC (permalink / raw)
  To: zsh-workers


Another build-time warning on FreeBSD-12:

nawk -f ./rlimits.awk /usr/include/sys/resource.h /dev/null > rlimits.h
WARNING: unknown limits: mail Src/Builtins/rlimits.h to developers

sys/resource.h defines a macro RLIMIT_UMTXP (=14), and /usr/bin/limits
refers to this as "umtxp". /usr/bin/ulimit (= builtin ulimit of /bin/sh)
uses the description "umtx shared locks" and the option '-o' for it.



diff --git a/Src/Builtins/rlimits.awk b/Src/Builtins/rlimits.awk
index fe2d0e931..e9c576c66 100644
--- a/Src/Builtins/rlimits.awk
+++ b/Src/Builtins/rlimits.awk
@@ -59,6 +59,7 @@ BEGIN {limidx = 0}
 	    if (limnam == "NPTS")    { msg[limnum] = "Npseudoterminals" }
 	    if (limnam == "SWAP")    { msg[limnum] = "Mswapsize" }
 	    if (limnam == "KQUEUES") { msg[limnum] = "Nkqueues" }
+	    if (limnam == "UMTXP")   { msg[limnum] = "Numtxp" }
         }
     }
 }
diff --git a/Src/Builtins/rlimits.c b/Src/Builtins/rlimits.c
index 29f97b41d..6b552f3a9 100644
--- a/Src/Builtins/rlimits.c
+++ b/Src/Builtins/rlimits.c
@@ -413,6 +413,12 @@ printulimit(char *nam, int lim, int hard, int head)
 	    printf("-k: kqueues                         ");
 	break;
 # endif /* HAVE_RLIMIT_KQUEUES */
+# ifdef HAVE_RLIMIT_UMTXP
+    case RLIMIT_UMTXP:
+	if (head)
+	    printf("-o: umtx shared locks               ");
+	break;
+# endif /* HAVE_RLIMIT_UMTXP */
     default:
 	if (head)
 	    printf("-N %2d:                              ", lim);
@@ -894,6 +900,11 @@ bin_ulimit(char *name, char **argv, UNUSED(Options ops), UNUSED(int func))
 		case 'T':
 		    res = RLIMIT_PTHREAD;
 		    break;
+# endif
+# ifdef HAVE_RLIMIT_UMTXP
+		case 'o':
+		    res = RLIMIT_UMTXP;
+		    break;
 # endif
 		default:
 		    /* unrecognised limit */
diff --git a/configure.ac b/configure.ac
index 8a2664ed2..2da134b90 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1880,6 +1880,7 @@ zsh_LIMIT_PRESENT(RLIMIT_POSIXLOCKS)
 zsh_LIMIT_PRESENT(RLIMIT_NPTS)
 zsh_LIMIT_PRESENT(RLIMIT_SWAP)
 zsh_LIMIT_PRESENT(RLIMIT_KQUEUES)
+zsh_LIMIT_PRESENT(RLIMIT_UMTXP)
 
 AH_TEMPLATE([RLIMIT_VMEM_IS_RSS],
 [Define to 1 if RLIMIT_VMEM and RLIMIT_RSS both exist and are equal.])





^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2019-08-26  9:19 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-08-26  9:18 [PATCH] support RLIMIT_UMTXP on FreeBSD Jun T

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).