2 * Copyright 2007, Axel Dörfler, axeld@pinc-software.de. All rights reserved.
3 * Distributed under the terms of the MIT License.
15 wait() should wait only once. If any argument is given, waitpid() should return
16 an error (and errno to ECHILD), since there is no child with that process group ID.
28 //! exits before child 2
38 // put us into a new process group
45 main(int argc
, char** argv
)
47 bool waitForGroup
= argc
> 1;
57 pid
= waitpid(0, &childStatus
, 0);
59 pid
= wait(&childStatus
);
60 printf("wait() returned %ld (%s), child status %d\n",
61 pid
, strerror(errno
), childStatus
);