add a missing section header table index conversion
[tangerine.git] / compiler / clib / getppid.c
blobede7f22e0603391f5df9f9e715bc824b7d62f424
1 /*
2 Copyright © 2004, The AROS Development Team. All rights reserved.
3 $Id$
4 */
6 #include <unistd.h>
7 #include <sys/types.h>
9 #include <exec/tasks.h>
10 #include <proto/exec.h>
12 #include <assert.h>
14 pid_t getppid(void)
16 struct Task *ThisTask, *ParentTask;
17 struct ETask *eThisTask;
19 ThisTask = FindTask(NULL);
20 eThisTask = GetETask(ThisTask);
21 assert(eThisTask);
22 ParentTask = (struct Task *)eThisTask->et_Parent;
23 return (pid_t)ParentTask;