2 Copyright © 1995-2014, The AROS Development Team. All rights reserved.
6 #include <proto/exec.h>
7 #include <dos/dosextens.h>
19 struct Process
*child
;
21 struct TagItem tags
[] =
23 { NP_Entry
, (IPTR
) entry
},
24 { NP_Cli
, (IPTR
) TRUE
},
25 { NP_Name
, (IPTR
) "test" },
26 { NP_NotifyOnDeath
, (IPTR
) TRUE
},
30 child
= CreateNewProc(tags
);
35 ULONG childid
= GetETask((struct Task
*) child
)->et_UniqueID
;
36 Printf("Checking status value for non-existing child id\n");
37 childstatus
= ChildStatus(-1);
38 assert(childstatus
== CHILD_NOTFOUND
);
39 Printf("Result: CHILD_NOTFOUND\n");
40 Printf("Checking status value for running child id\n");
41 childstatus
= ChildStatus(childid
);
42 assert(childstatus
== CHILD_ACTIVE
);
43 Printf("Result: CHILD_ACTIVE\n");
45 Printf("Checking status value for died child id\n");
46 childstatus
= ChildStatus(childid
);
47 assert(childstatus
== CHILD_EXITED
);
48 Printf("Result: CHILD_EXITED\n");
50 Printf("Checking status value for freed child id\n");
51 childstatus
= ChildStatus(childid
);
52 assert(childstatus
== CHILD_NOTFOUND
);
53 Printf("Result: CHILD_NOTFOUND\n");
56 PrintFault(IoErr(), "Couldn't create child process");