| 1 |
/* COVERAGE: vfork wait4 */ |
| 2 |
#include <sys/types.h> |
| 3 |
#include <sys/time.h> |
| 4 |
#include <sys/resource.h> |
| 5 |
#include <sys/wait.h> |
| 6 |
#include <stdlib.h> |
| 7 |
#include <unistd.h> |
| 8 |
|
| 9 |
int main () |
| 10 |
{ |
| 11 |
pid_t child; |
| 12 |
int status; |
| 13 |
|
| 14 |
child = vfork(); |
| 15 |
#if !(defined(__ia64__) || defined(__aarch64__)) |
| 16 |
//staptest// vfork () = NNNN |
| 17 |
#else |
| 18 |
// On RHEL5 ia64, vfork() gets turned into clone() (not |
| 19 |
// clone2() strangely enough). |
| 20 |
//staptest// [[[[vfork ()!!!!clone (.+, XXXX, XXXX, XXXX)]]]] = NNNN |
| 21 |
#endif |
| 22 |
if (!child) { |
| 23 |
int i = 0xfffff; |
| 24 |
while (i > 0) i--; |
| 25 |
_exit(0); |
| 26 |
} |
| 27 |
wait4(child, &status, WNOHANG, NULL); |
| 28 |
//staptest// wait4 (NNNN, XXXX, WNOHANG, XXXX) = NNNN |
| 29 |
|
| 30 |
return 0; |
| 31 |
} |