4 #include <aros/debug.h>
8 #define EXIT_STATUS 123
15 char *argv
[] = { "Delay", "50", NULL
};
16 char *envp
[] = { NULL
};
18 wait_pid
= waitpid(666, NULL
, 0);
20 TEST(errno
== ECHILD
);
25 printf("Created child with pid %d\n", (int) pid
);
26 printf("Waiting for child with pid %d to exit.\n", (int) pid
);
27 wait_pid
= waitpid(pid
, &status
, 0);
28 TEST((wait_pid
== pid
));
29 printf("Child %d exited with exit status %d\n", (int) wait_pid
, status
);
30 TEST((status
== EXIT_STATUS
));
34 printf("Exiting with status %d\n", EXIT_STATUS
);
45 printf("Created child with pid %d\n", (int) pid
);
46 printf("Waiting for any child to exit.\n");
47 wait_pid
= waitpid(-1, &status
, 0);
48 TEST((wait_pid
== pid
));
49 printf("Child %d exited with exit status %d\n", (int) wait_pid
, status
);
50 TEST((status
== EXIT_STATUS
));
54 printf("Exiting with status %d\n", EXIT_STATUS
);
65 printf("Created child with pid %d\n", (int) pid
);
66 printf("Waiting for any child to exit without hang.\n");
67 wait_pid
= waitpid(-1, &status
, WNOHANG
);
69 wait_pid
= waitpid(-1, &status
, 0);
70 TEST((wait_pid
== pid
));
71 printf("Child %d exited with exit status %d\n", (int) wait_pid
, status
);
72 TEST((status
== EXIT_STATUS
));
76 printf("Exiting with status %d\n", EXIT_STATUS
);
87 printf("Created child with pid %d\n", (int) pid
);
88 printf("Waiting for any child to exit without hang.\n");
89 wait_pid
= waitpid(-1, &status
, WNOHANG
);
90 TEST((wait_pid
== 0));
91 printf("Child didn't exit yet\n");
92 wait_pid
= waitpid(-1, &status
, 0);
93 TEST((wait_pid
== pid
));
94 printf("Child %d exited with exit status %d\n", (int) wait_pid
, status
);
100 execve("C:Delay", argv
, envp
);