On 10/29/2012 10:06 AM, Eli Zaretskii wrote: > Since we are now asking about a single > process at a time, I don't see why we need a loop inside a loop. Good point, and this is a performance regression, since the old code was O(N) and the new O(N**2). I have fixed that in a revised proposal (attached). While fixing this I found another regression, as already successfully- waited-for processes were being waited-for again. This is also fixed in the revised proposal. > Btw, what about Posix platforms that don't have WNOHANG defined, There aren't any anymore. Posix has required WNOHANG since Posix.1-1988 and everybody has it implemented by now. I've added a comment to that effect. (I also added a comment along the line that cyd suggested.) > (The cpp directives don't match.) Thanks, fixed in the attached proposal. > I guess time is ripe for refactoring that code into an emulation > of 'waitpid'. Yes, that'd be nice. The attached proposal puts that into a FIXME comment. > We use record_child_status_change in another place as well: in > sysdep.c:wait_for_termination_1. Will the change in the former still > work correctly in the latter (and its callers)? Yes, it should. One uses -1 as the pid as a special indicator; the other doesn't, and the implementation treats -1 specially. Thanks for the review.