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

PATCH: pipebuf resource limit on FreeBSD



There's a relatively new resource limit on FreeBSD which this patch
handles. The documentation doesn't make it especially clear what the
correct units are but with a multiplier of 1024, it matches how the
system ulimit command works.

It appears that not all new limits have been added to the documentation
so this adds a few others that were missing there.

Oliver

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)




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