1
0
Fork 0
mirror of git://git.code.sf.net/p/zsh/code synced 2025-09-04 10:41:11 +02:00

30629 plus unposted formatting changes:

support socket buffer size limit properly in ulimit;
improve consistency of output and documentation and tweak formatting appropriately
This commit is contained in:
Peter Stephenson 2012-08-17 13:26:22 +00:00
parent 9fdcd824d8
commit e92a823a4b
3 changed files with 46 additions and 36 deletions

View file

@ -1,5 +1,11 @@
2012-08-17 Peter Stephenson <pws@csr.com>
* 30629 plus unposted formatting improvements:
Doc/Zsh/builtins.yo, Src/Builtins/rlimits.c: more complete
handling for socket buffer size limit (NetBSD) plus formatting
and consistency changes (kb -> kbytes everywhere in ulimit
output, K-bytes to kilobytes everywhere in documentation).
* 30627: configure.ac, Doc/Zsh/builtins.yo,
Src/Builtins/rlimits.awk, Src/Builtins/rlimits.c:
support RLIMIT_NTHR as on NetBSD.
@ -67,5 +73,5 @@
*****************************************************
* This is used by the shell to define $ZSH_PATCHLEVEL
* $Revision: 1.5700 $
* $Revision: 1.5701 $
*****************************************************

View file

@ -1764,19 +1764,20 @@ tt(ulimit -a) will show which are supported.
startsitem()
sitem(tt(-a))(Lists 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))(K-bytes on the size of the data segment.)
sitem(tt(-d))(Kilobytes on the size of the data segment.)
sitem(tt(-f))(512-byte blocks on the size of files written.)
sitem(tt(-i))(The number of pending signals.)
sitem(tt(-l))(K-bytes on the size of locked-in memory.)
sitem(tt(-m))(K-bytes on the size of physical memory.)
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(-q))(Bytes in POSIX message queues.)
sitem(tt(-s))(K-bytes on the size of the stack.)
sitem(tt(-s))(Kilobytes on the size of the stack.)
sitem(tt(-t))(CPU seconds to be used.)
sitem(tt(-r))(The number of simultaneous threads available to the user.)
sitem(tt(-u))(The number of processes available to the user.)
sitem(tt(-v))(K-bytes on the size of virtual memory. On some systems this
sitem(tt(-v))(Kilobytes on the size of virtual memory. On some systems this
refers to the limit called `address space'.)
sitem(tt(-x))(The number of locks on files.)
endsitem()

View file

@ -263,7 +263,7 @@ printulimit(char *nam, int lim, int hard, int head)
# ifdef HAVE_RLIMIT_MEMLOCK
case RLIMIT_MEMLOCK:
if (head)
printf("-l: locked-in-memory size (kb) ");
printf("-l: locked-in-memory size (kbytes) ");
if (limit != RLIM_INFINITY)
limit /= 1024;
break;
@ -281,7 +281,7 @@ printulimit(char *nam, int lim, int hard, int head)
# if defined(HAVE_RLIMIT_VMEM) && defined(HAVE_RLIMIT_RSS) && defined(RLIMIT_VMEM_IS_RSS)
case RLIMIT_VMEM:
if (head)
printf("-m: memory size (kb) ");
printf("-m: memory size (kbytes) ");
if (limit != RLIM_INFINITY)
limit /= 1024;
break;
@ -323,7 +323,7 @@ printulimit(char *nam, int lim, int hard, int head)
# if defined(HAVE_RLIMIT_VMEM) && (!defined(HAVE_RLIMIT_RSS) || !defined(RLIMIT_VMEM_IS_RSS))
case RLIMIT_VMEM:
if (head)
printf("-v: virtual memory size (kb) ");
printf("-v: virtual memory size (kbytes) ");
if (limit != RLIM_INFINITY)
limit /= 1024;
break;
@ -331,7 +331,7 @@ printulimit(char *nam, int lim, int hard, int head)
# if defined HAVE_RLIMIT_AS && !defined(RLIMIT_VMEM_IS_AS)
case RLIMIT_AS:
if (head)
printf("-v: address space (kb) ");
printf("-v: address space (kbytes) ");
if (limit != RLIM_INFINITY)
limit /= 1024;
break;
@ -345,7 +345,7 @@ printulimit(char *nam, int lim, int hard, int head)
# ifdef HAVE_RLIMIT_AIO_MEM
case RLIMIT_AIO_MEM:
if (head)
printf("-N %2d: AIO locked-in-memory (kb) ", RLIMIT_AIO_MEM);
printf("-N %2d: AIO locked-in-memory (kbytes)", RLIMIT_AIO_MEM);
if (limit != RLIM_INFINITY)
limit /= 1024;
break;
@ -365,9 +365,7 @@ printulimit(char *nam, int lim, int hard, int head)
# ifdef HAVE_RLIMIT_SBSIZE
case RLIMIT_SBSIZE:
if (head)
printf("-N %2d: socket buffer size (kb) ", RLIMIT_SBSIZE);
if (limit != RLIM_INFINITY)
limit /= 1024;
printf("-b: socket buffer size (bytes) ", RLIMIT_SBSIZE);
break;
# endif /* HAVE_RLIMIT_SBSIZE */
# ifdef HAVE_RLIMIT_PTHREAD
@ -782,16 +780,21 @@ bin_ulimit(char *name, char **argv, UNUSED(Options ops), UNUSED(int func))
case 'c':
res = RLIMIT_CORE;
break;
# ifdef HAVE_RLIMIT_RSS
case 'm':
res = RLIMIT_RSS;
# ifdef HAVE_RLIMIT_SBSIZE
case 'b':
res = RLIMIT_SBSIZE;
break;
# endif /* HAVE_RLIMIT_RSS */
# endif /* HAVE_RLIMIT_SBSIZE */
# ifdef HAVE_RLIMIT_MEMLOCK
case 'l':
res = RLIMIT_MEMLOCK;
break;
# endif /* HAVE_RLIMIT_MEMLOCK */
# ifdef HAVE_RLIMIT_RSS
case 'm':
res = RLIMIT_RSS;
break;
# endif /* HAVE_RLIMIT_RSS */
# ifdef HAVE_RLIMIT_NOFILE
case 'n':
res = RLIMIT_NOFILE;