1 #include <proto/exec.h>
2 #include <dos/dosextens.h>
14 struct Process
*child
;
16 struct TagItem tags
[] =
18 { NP_Entry
, (IPTR
) entry
},
19 { NP_Cli
, (IPTR
) TRUE
},
20 { NP_Name
, (IPTR
) "test" },
21 { NP_NotifyOnDeath
, (IPTR
) TRUE
},
25 child
= CreateNewProc(tags
);
30 ULONG childid
= GetETask((struct Task
*) child
)->et_UniqueID
;
31 Printf("Checking status value for non-existing child id\n");
32 childstatus
= ChildStatus(-1);
33 assert(childstatus
== CHILD_NOTFOUND
);
34 Printf("Result: CHILD_NOTFOUND\n");
35 Printf("Checking status value for running child id\n");
36 childstatus
= ChildStatus(childid
);
37 assert(childstatus
== CHILD_ACTIVE
);
38 Printf("Result: CHILD_ACTIVE\n");
40 Printf("Checking status value for died child id\n");
41 childstatus
= ChildStatus(childid
);
42 assert(childstatus
== CHILD_EXITED
);
43 Printf("Result: CHILD_EXITED\n");
45 Printf("Checking status value for freed child id\n");
46 childstatus
= ChildStatus(childid
);
47 assert(childstatus
== CHILD_NOTFOUND
);
48 Printf("Result: CHILD_NOTFOUND\n");
51 PrintFault(IoErr(), "Couldn't create child process");