mirror of
git://git.code.sf.net/p/zsh/code
synced 2025-01-01 05:16:05 +01:00
31936: Rationalise limits for threads
This commit is contained in:
parent
93dec3a96a
commit
73746daf7f
4 changed files with 12 additions and 15 deletions
|
@ -1,5 +1,9 @@
|
|||
2013-11-03 Peter Stephenson <p.w.stephenson@ntlworld.com>
|
||||
|
||||
* Stefan Neudorf: 31936: Doc/Zsh/builtins.yo,
|
||||
Src/Builtins/rlimits.awk, Src/Builtins/rlimits.c: rationalise
|
||||
thread limits
|
||||
|
||||
* Stefan Neudorf: 31935: Doc/Zsh/builtins.yo,
|
||||
Src/Builtins/rlimits.awk, Src/Builtins/rlimits.c: further
|
||||
limit updates for 31930, 39134.
|
||||
|
|
|
@ -1897,7 +1897,7 @@ enditem()
|
|||
findex(ulimit)
|
||||
cindex(resource limits)
|
||||
cindex(limits, resource)
|
||||
item(tt(ulimit) [ [ tt(-SHacdfiklmnpqrstvwx) | tt(-N) var(resource) [ var(limit) ] ... ])(
|
||||
item(tt(ulimit) [ [ tt(-SHacdfiklmnpqsTtvwx) | tt(-N) var(resource) [ var(limit) ] ... ])(
|
||||
Set or display resource limits of the shell and the processes started by
|
||||
the shell. The value of var(limit) can be a number in the unit specified
|
||||
below or one of the values `tt(unlimited)', which removes the limit on the
|
||||
|
@ -1935,8 +1935,8 @@ sitem(tt(-n))(open file descriptors.)
|
|||
sitem(tt(-p))(The number of pseudo-terminals.)
|
||||
sitem(tt(-q))(Bytes in POSIX message queues.)
|
||||
sitem(tt(-s))(Kilobytes on the size of the stack.)
|
||||
sitem(tt(-T))(The number of simultaneous threads available to the user.)
|
||||
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))(Kilobytes on the size of virtual memory. On some systems this
|
||||
refers to the limit called `address space'.)
|
||||
|
|
|
@ -42,7 +42,7 @@ BEGIN {limidx = 0}
|
|||
if (limnam == "MEMLOCK") { msg[limnum] = "Mmemorylocked" }
|
||||
if (limnam == "NOFILE") { msg[limnum] = "Ndescriptors" }
|
||||
if (limnam == "NPROC") { msg[limnum] = "Nmaxproc" }
|
||||
if (limnam == "NTHR") { msg[limnum] = "Nmaxthr" }
|
||||
if (limnam == "NTHR") { msg[limnum] = "Nmaxpthreads" }
|
||||
if (limnam == "OFILE") { msg[limnum] = "Ndescriptors" }
|
||||
if (limnam == "PTHREAD") { msg[limnum] = "Nmaxpthreads" }
|
||||
if (limnam == "RSS") { msg[limnum] = "Mresident" }
|
||||
|
|
|
@ -36,6 +36,10 @@
|
|||
# define RLIMIT_LOCKS RLIMIT_POSIXLOCKS
|
||||
#endif
|
||||
|
||||
#ifdef RLIMIT_NTHR
|
||||
# define RLIMIT_PTHREAD RLIMIT_NTHR
|
||||
#endif
|
||||
|
||||
enum {
|
||||
ZLIMTYPE_MEMORY,
|
||||
ZLIMTYPE_NUMBER,
|
||||
|
@ -318,12 +322,6 @@ printulimit(char *nam, int lim, int hard, int head)
|
|||
printf("-u: processes ");
|
||||
break;
|
||||
# endif /* HAVE_RLIMIT_NPROC */
|
||||
# ifdef HAVE_RLIMIT_NTHR
|
||||
case RLIMIT_NTHR:
|
||||
if (head)
|
||||
printf("-r: threads ");
|
||||
break;
|
||||
#endif /* HAVE_RLIMIT_NTHR */
|
||||
# if defined(HAVE_RLIMIT_VMEM) && (!defined(HAVE_RLIMIT_RSS) || !defined(RLIMIT_VMEM_IS_RSS))
|
||||
case RLIMIT_VMEM:
|
||||
if (head)
|
||||
|
@ -375,7 +373,7 @@ printulimit(char *nam, int lim, int hard, int head)
|
|||
# ifdef HAVE_RLIMIT_PTHREAD
|
||||
case RLIMIT_PTHREAD:
|
||||
if (head)
|
||||
printf("-N %2d: threads per process ", RLIMIT_PTHREAD);
|
||||
printf("-T: threads per process ");
|
||||
break;
|
||||
# endif /* HAVE_RLIMIT_PTHREAD */
|
||||
# ifdef HAVE_RLIMIT_NICE
|
||||
|
@ -824,11 +822,6 @@ bin_ulimit(char *name, char **argv, UNUSED(Options ops), UNUSED(int func))
|
|||
res = RLIMIT_NOFILE;
|
||||
break;
|
||||
# endif /* HAVE_RLIMIT_NOFILE */
|
||||
# ifdef HAVE_RLIMIT_NTHR
|
||||
case 'r':
|
||||
res = RLIMIT_NTHR;
|
||||
break;
|
||||
# endif /* HAVE_RLIMIT_NTHR */
|
||||
# ifdef HAVE_RLIMIT_NPROC
|
||||
case 'u':
|
||||
res = RLIMIT_NPROC;
|
||||
|
|
Loading…
Reference in a new issue