mirror of
https://gitlab.com/sortix/sortix.git
synced 2023-02-13 20:55:38 -05:00
Run time(1) children in their own process group.
This commit is contained in:
parent
ebb75f656c
commit
f384fcdff1
1 changed files with 5 additions and 0 deletions
|
@ -40,13 +40,18 @@ int main(int argc, char* argv[])
|
|||
error(1, errno, "fork");
|
||||
if ( !child_pid )
|
||||
{
|
||||
setpgid(child_pid, child_pid);
|
||||
tcsetpgrp(0, child_pid);
|
||||
if ( argc <= 1 )
|
||||
exit(0);
|
||||
execvp(argv[1], argv+1);
|
||||
error(127, errno, "%s", argv[1]);
|
||||
}
|
||||
setpgid(child_pid, child_pid);
|
||||
tcsetpgrp(0, child_pid);
|
||||
int exit_status = 0;
|
||||
waitpid(child_pid, &exit_status, 0);
|
||||
tcsetpgrp(0, getpgid(0));
|
||||
|
||||
struct timespec end_time;
|
||||
clock_gettime(CLOCK_MONOTONIC, &end_time);
|
||||
|
|
Loading…
Reference in a new issue