On 7/25/12 11:59 AM, Michael Haubenwallner wrote: > > On 07/25/2012 04:50 PM, Chet Ramey wrote: >>> The AIX 6.1 I've debugged on has: >>> #define CHILD_MAX 128 >>> #define _POSIX_CHILD_MAX 25 >>> sysconf(_SC_CHILD_MAX) = 1024 > >> Bash prefers sysconf(_SC_CHILD_MAX) and will use it over the other >> defines (lib/sh/oslib.c:getmaxchild()). I don't know why AIX chooses >> to return a different value via sysconf than it defines for CHILD_MAX, >> especially when it seems to use the CHILD_MAX value to decide when it >> can recycle the PID space. > > Well, _SC_CHILD_MAX is documented across platforms as: > (Linux) "The max number of simultaneous processes per user ID." > (HP-UX) "Maximum number of simultaneous processes per user ID." > (Solaris) "Max processes allowed to a UID" > (AIX) "Specifies the number of simultaneous processes per real user ID." > (Interix) "Maximum number of simultaneous processes per user ID." > > Also, one Linux machine actually shows the _SC_CHILD_MAX value equal to > kernel.pid_max (32768 here), so even Linux could see this problem in theory, > because PIDs really are recycled before kernel.pid_max.
That's interesting, since Posix describes sysconf() as simply a way to retrieve values from limits.h or unistd.h that one wishes to get at run time rather than compile time. And interesting that it establishes a correspondence between CHILD_MAX and _SC_CHILD_MAX. > >> And I suspect that the single change of significance is to not check >> against the childmax value when deciding whether or not to look for and >> remove this pid from the list of saved termination status values. > > Agreed - but is this still different to defining RECYCLES_PIDS then? It is not. It is one of the things that happens when you define RECYCLES_PIDS. The question is whether or not that is the single thing that makes a difference in this case. If it is, there is merit in removing the check against js.c_childmax entirely or making it dependent on something else. Chet -- ``The lyf so short, the craft so long to lerne.'' - Chaucer ``Ars longa, vita brevis'' - Hippocrates Chet Ramey, ITS, CWRU c...@case.edu http://cnswww.cns.cwru.edu/~chet/