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.

> 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?

Thank you!
/haubi/

Reply via email to