summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOliver Kiddle <opk@zsh.org>2025-02-27 16:02:02 +0100
committerOliver Kiddle <opk@zsh.org>2025-02-27 16:02:02 +0100
commite160cf85f05c3106189edf2158146b9f522d1f1c (patch)
tree5b7aa4fda7a86bdf67b45f0a36c3d32e780028a4
parent8701313c615394654f47586c9a4961ac8893bf5b (diff)
downloadzsh-e160cf85f05c3106189edf2158146b9f522d1f1c.tar.gz
zsh-e160cf85f05c3106189edf2158146b9f522d1f1c.zip
53378: support new pipebuf resource limit on FreeBSD
Also add other newer limits to the documentation.
-rw-r--r--ChangeLog5
-rw-r--r--Doc/Zsh/builtins.yo14
-rw-r--r--Src/Builtins/rlimits.c4
-rw-r--r--configure.ac1
4 files changed, 22 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index 05aa89c88..80745557f 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2025-02-27 Oliver Kiddle <opk@zsh.org>
+
+ * 53378: Doc/Zsh/builtins.yo, Src/Builtins/rlimits.c, configure.ac:
+ support new pipebuf resource limit on FreeBSD
+
2025-02-15 Bart Schaefer <schaefer@zsh.org>
* 53363: Src/builtin.c: permit "typeset -n +m pattern"
diff --git a/Doc/Zsh/builtins.yo b/Doc/Zsh/builtins.yo
index 69bb86a0f..103b6d842 100644
--- a/Doc/Zsh/builtins.yo
+++ b/Doc/Zsh/builtins.yo
@@ -1218,19 +1218,26 @@ sitem(tt(datasize))(Maximum data size (including stack) for each process.)
sitem(tt(descriptors))(Maximum value for a file descriptor.)
sitem(tt(filesize))(Largest single file allowed.)
sitem(tt(kqueues))(Maximum number of kqueues allocated.)
+sitem(tt(maxfilelocks))(Maximum number of file locks.)
sitem(tt(maxproc))(Maximum number of processes.)
sitem(tt(maxpthreads))(Maximum number of threads per process.)
sitem(tt(memorylocked))(Maximum amount of memory locked in RAM.)
sitem(tt(memoryuse))(Maximum resident set size.)
sitem(tt(msgqueue))(Maximum number of bytes in POSIX message queues.)
+sitem(tt(nice))(Maximum nice value.)
+sitem(tt(pipebuf))(Maximum size of buffers for pipes/fifos.)
sitem(tt(posixlocks))(Maximum number of POSIX locks per user.)
sitem(tt(pseudoterminals))(Maximum number of pseudo-terminals.)
sitem(tt(resident))(Maximum resident set size.)
+sitem(tt(rt_priority))(Maximum real-time priority.)
+sitem(tt(rt_time))(Maximum CPU time without a blocking system call.)
sitem(tt(sigpending))(Maximum number of pending signals.)
sitem(tt(sockbufsize))(Maximum size of all socket buffers.)
sitem(tt(stacksize))(Maximum stack size for each process.)
sitem(tt(swapsize))(Maximum amount of swap used.)
+sitem(tt(umtxp))(Maximum number of POSIX thread library objects.)
sitem(tt(vmemorysize))(Maximum amount of virtual memory.)
+sitem(tt(vnodemonitors))(Maximum number of open vnode monitors.)
endsitem()
Which of these resource limits are available depends on the system.
@@ -2390,16 +2397,18 @@ Not all the following resources are supported on all systems. Running
tt(ulimit -a) will show which are supported.
startsitem()
-sitem(tt(-a))(Lists all of the current resource limits.)
+sitem(tt(-a))(List all of the current resource limits.)
sitem(tt(-b))(Socket buffer size in bytes LPAR()N.B. not kilobytes+RPAR())
sitem(tt(-c))(512-byte blocks on the size of core dumps.)
sitem(tt(-d))(Kilobytes on the size of the data segment.)
+sitem(tt(-e))(Maximum nice value.)
sitem(tt(-f))(512-byte blocks on the size of files written.)
sitem(tt(-i))(The number of pending signals.)
sitem(tt(-k))(The number of kqueues allocated.)
sitem(tt(-l))(Kilobytes on the size of locked-in memory.)
sitem(tt(-m))(Kilobytes on the size of physical memory.)
-sitem(tt(-n))(open file descriptors.)
+sitem(tt(-n))(Open file descriptors.)
+sitem(tt(-o))(Maximum number of POSIX thread library objects.)
sitem(tt(-p))(The number of pseudo-terminals.)
sitem(tt(-q))(Bytes in POSIX message queues.)
sitem(tt(-r))(Maximum real time priority. On some systems where this
@@ -2413,6 +2422,7 @@ sitem(tt(-v))(Kilobytes on the size of virtual memory. On some systems this
refers to the limit called `address space'.)
sitem(tt(-w))(Kilobytes on the size of swapped out memory.)
sitem(tt(-x))(The number of locks on files.)
+sitem(tt(-y))(Maximum size of buffers for pipes/fifos.)
endsitem()
A resource may also be specified by integer in the form `tt(-N)
diff --git a/Src/Builtins/rlimits.c b/Src/Builtins/rlimits.c
index f25dd2530..65226dc9a 100644
--- a/Src/Builtins/rlimits.c
+++ b/Src/Builtins/rlimits.c
@@ -145,6 +145,10 @@ static const resinfo_T known_resources[] = {
{RLIMIT_UMTXP, "umtxp", ZLIMTYPE_NUMBER, 1,
'o', "umtx shared locks"},
# endif
+# ifdef HAVE_RLIMIT_PIPEBUF /* FreeBSD */
+ {RLIMIT_PIPEBUF, "pipebuf", ZLIMTYPE_MEMORY, 1024,
+ 'y', "size of buffers for pipes/fifos"},
+#endif
# ifdef HAVE_RLIMIT_POSIXLOCKS /* DragonFly */
{RLIMIT_POSIXLOCKS, "posixlocks", ZLIMTYPE_NUMBER, 1,
diff --git a/configure.ac b/configure.ac
index b5548c2b9..db0828a56 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1873,6 +1873,7 @@ zsh_LIMIT_PRESENT(RLIMIT_NPTS)
zsh_LIMIT_PRESENT(RLIMIT_SWAP)
zsh_LIMIT_PRESENT(RLIMIT_KQUEUES)
zsh_LIMIT_PRESENT(RLIMIT_UMTXP)
+zsh_LIMIT_PRESENT(RLIMIT_PIPEBUF)
zsh_LIMIT_PRESENT(RLIMIT_NOVMON)
zsh_LIMITS_EQUAL(VMEM, vmem, RSS, rss)