On 12/25/11 10:51 AM, Askar Safin wrote: > In jobs.c we see: > > #if defined (RECYCLES_PIDS) > if (last_asynchronous_pid == mypid) > /* Avoid pid aliasing. 1 seems like a safe, unusual pid value. */ > last_asynchronous_pid = 1; > #endif > > 1 is not safe, unusual PID value, because:
For the purposes of that code fragment, 1 is both safe and unusual. Look at where it appears and what it does. We're trying to avoid a situation where the pid remembered as the last asynchronous pid is the same as that of a just-forked child. Since pid 1 is usually present and long lived, it's unlikely that a just-forked child will have pid 1, even if init (usually pid 1) is an instance of bash. 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/