zsh-workers
 help / color / mirror / code / Atom feed
From: Jun T <takimoto-j@kba.biglobe.ne.jp>
To: zsh-workers@zsh.org
Subject: [PATCH] support RLIMIT_UMTXP on FreeBSD
Date: Mon, 26 Aug 2019 18:18:24 +0900	[thread overview]
Message-ID: <2B491CB5-5FA8-40A1-8449-8E62A3C5A542@kba.biglobe.ne.jp> (raw)


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.])





                 reply	other threads:[~2019-08-26  9:19 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=2B491CB5-5FA8-40A1-8449-8E62A3C5A542@kba.biglobe.ne.jp \
    --to=takimoto-j@kba.biglobe.ne.jp \
    --cc=zsh-workers@zsh.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).