2 Copyright © 1995-2014, The AROS Development Team. All rights reserved.
8 #include <aros/debug.h>
16 /* Test vfork and a child doing execl() */
20 printf("I'm parent, I have a child with pid %d\n", (int) pid
);
21 waitpid(pid
, NULL
, 0);
25 execl("C:Echo", "Echo", "I'm child", NULL
);
34 /* Testing child trying to exec non-existing program */
38 printf("I'm parent, I have a child with pid %d\n", (int) pid
);
39 waitpid(pid
, NULL
, 0);
43 TEST(execl(":XYZ/NotExist", "NotExist", "I'm child", NULL
) == -1);
51 /* Testing nested vfork() + execl() */
55 printf("I'm parent, I have a first child with pid %d\n", (int) pid
);
59 printf("I'm parent, I have a second child with pid %d\n", (int) pid2
);
60 waitpid(pid2
, NULL
, 0);
64 execl("C:Echo", "Echo", "I'm the second child of a parent", NULL
);
67 waitpid(pid
, NULL
, 0);
71 //printf("I'm child of a parent\n");
75 //printf("I'm child, I have my child with pid %d\n", (int) pid2);
76 waitpid(pid2
, NULL
, 0);
80 execl("C:Echo", "Echo", "I'm child of a child", NULL
);