Removed double NAME entry.
[AROS.git] / compiler / clib / getpid.c
blobc7cf7640e998b1a06a1a6eca4d16a2cde09f0492
1 /*
2 Copyright © 1995-2012, The AROS Development Team. All rights reserved.
3 $Id$
5 POSIX function getpid().
6 */
8 #include <proto/exec.h>
9 #include <assert.h>
11 #include "__vfork.h"
12 #include "__arosc_privdata.h"
14 /*****************************************************************************
16 NAME */
17 #include <sys/types.h>
18 #include <unistd.h>
20 pid_t getpid (
22 /* SYNOPSIS */
25 /* FUNCTION
26 Returns the process ID of the calling process
28 RESULT
29 The process ID of the calling process.
31 NOTES
33 EXAMPLE
35 BUGS
37 SEE ALSO
39 INTERNALS
41 ******************************************************************************/
43 struct aroscbase *aroscbase = __aros_getbase_aroscbase();
44 struct ETask *et;
46 if(aroscbase->acb_flags & PRETEND_CHILD)
48 struct vfork_data *udata = aroscbase->acb_vfork_data;
49 et = GetETask(udata->child);
51 else
52 et = GetETask(FindTask(NULL));
53 assert(et);
54 return (pid_t) et->et_UniqueID;
55 } /* getpid */