#include <sys/types.h> #include <unistd.h> pid_t getpid(void);
The getpid() function returns the process ID of the calling process.
None
None.
pid_t | The value returned by getpid() is the process ID of the calling process. |
The getpid() function is always successful and does not return an error.
The getpid() function enables a process for signals if the process is not already enabled for signals. For details, see Qp0sEnableSignals()--Enable Process for Signals.
See Code disclaimer information for information pertaining to code examples.
For an example of using this function, see the child program in Using the Spawn Process and Wait for Child Process APIs
Top | UNIX-Type APIs | APIs by category |