2 Copyright © 1995-2014, The AROS Development Team. All rights reserved.
9 #include <aros/debug.h>
13 #define EXIT_STATUS 123
20 char *argv
[] = { "Delay", "50", NULL
};
21 char *envp
[] = { NULL
};
23 wait_pid
= waitpid(666, NULL
, 0);
25 TEST(errno
== ECHILD
);
30 printf("Created child with pid %d\n", (int) pid
);
31 printf("Waiting for child with pid %d to exit.\n", (int) pid
);
32 wait_pid
= waitpid(pid
, &status
, 0);
33 TEST((wait_pid
== pid
));
34 printf("Child %d exited with exit status %d\n", (int) wait_pid
, status
);
35 TEST((status
== EXIT_STATUS
));
39 printf("Exiting with status %d\n", EXIT_STATUS
);
50 printf("Created child with pid %d\n", (int) pid
);
51 printf("Waiting for any child to exit.\n");
52 wait_pid
= waitpid(-1, &status
, 0);
53 TEST((wait_pid
== pid
));
54 printf("Child %d exited with exit status %d\n", (int) wait_pid
, status
);
55 TEST((status
== EXIT_STATUS
));
59 printf("Exiting with status %d\n", EXIT_STATUS
);
70 printf("Created child with pid %d\n", (int) pid
);
71 printf("Waiting for any child to exit without hang.\n");
72 wait_pid
= waitpid(-1, &status
, WNOHANG
);
74 wait_pid
= waitpid(-1, &status
, 0);
75 TEST((wait_pid
== pid
));
76 printf("Child %d exited with exit status %d\n", (int) wait_pid
, status
);
77 TEST((status
== EXIT_STATUS
));
81 printf("Exiting with status %d\n", EXIT_STATUS
);
92 printf("Created child with pid %d\n", (int) pid
);
93 printf("Waiting for any child to exit without hang.\n");
94 wait_pid
= waitpid(-1, &status
, WNOHANG
);
95 TEST((wait_pid
== 0));
96 printf("Child didn't exit yet\n");
97 wait_pid
= waitpid(-1, &status
, 0);
98 TEST((wait_pid
== pid
));
99 printf("Child %d exited with exit status %d\n", (int) wait_pid
, status
);
105 execve("C:Delay", argv
, envp
);