Next: Creating a Process, Previous: Process Creation Concepts, Up: Processes
The pid_t data type represents process IDs. You can get the
process ID of a process by calling getpid. The function
getppid returns the process ID of the parent of the current
process (this is also known as the parent process ID). Your
program should include the header files unistd.h and
sys/types.h to use these functions.
The
pid_tdata type is a signed integer type which is capable of representing a process ID. In the GNU library, this is anint.
The
getpidfunction returns the process ID of the current process.
The
getppidfunction returns the process ID of the parent of the current process.