Retrieve the process identification number.
Compatibility:This function is compatible with the following targets:
|
EMB/RTOS
|
|
#include <unistd.h>getpid() Macros:
|
Macro
|
|
Represents
|
|---|---|---|
The getpid() function returns the unique number (Process ID) for the calling process. Example of usage is given in "Example of getpid() usage."
getpid() returns an integer value.
NOTE
getpid() type functions don't really have any meaning on the Mac. The values returned are those that would make sense for a typical user process under UNIX.
getpid() always returns a value. There is no error returned.
#include <stdio.h>
#include <unistd.h>
int main(void)
{
printf("The process ID is %d\n", getpid());
return 0;
}
Result
The process ID is 9000
[ First ] [ Previous ] [ Next ] [ Last ] [ Manuals ]
Visit the Metrowerks website at: http://www.metrowerks.com
For assistance contact Metrowerks Technical Support at: cw_support@metrowerks.com
Copyright © 2000, Metrowerks Corp. All rights reserved.
Last updated: August 16, 2000