Re: waitpid vs ptrace

2020-01-30 Thread Philip Guenther
On Thu, 30 Jan 2020, Marc Espie wrote: > So, basically, if we start arbitrary commands, then > the classic loop > /* Wait for the child to exit. */ > while (waitpid(cpid, , 0) == -1 && errno == EINTR) > continue; > > is not quite enough. > > See the small note in manpages

waitpid vs ptrace

2020-01-30 Thread Marc Espie
So, basically, if we start arbitrary commands, then the classic loop /* Wait for the child to exit. */ while (waitpid(cpid, , 0) == -1 && errno == EINTR) continue; is not quite enough. See the small note in manpages (not only us, but everyone): WIFSTOPPED(status)