2 Copyright © 2004-2013, The AROS Development Team. All rights reserved.
8 #include <exec/tasks.h>
9 #include <proto/exec.h>
14 #include "__posixc_intbase.h"
16 /*****************************************************************************
27 Returns the Parent process ID of the calling processes.
43 ******************************************************************************/
45 struct PosixCIntBase
*PosixCBase
=
46 (struct PosixCIntBase
*)__aros_getbase_PosixCBase();
47 struct Task
*ParentTask
;
48 struct ETask
*eThisTask
;
51 if(PosixCBase
->flags
& PRETEND_CHILD
)
53 struct vfork_data
*udata
= PosixCBase
->vfork_data
;
54 eThisTask
= GetETask(udata
->child
);
57 eThisTask
= GetETask(FindTask(NULL
));
59 ParentTask
= (struct Task
*)eThisTask
->et_Parent
;
62 et
= GetETask(ParentTask
);
64 return (pid_t
) et
->et_UniqueID
;