
Click above to get retro games delivered to your door ever month!
X-Hacker.org- Turbo C - <b>getpid() get process id</b>
[<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
getpid() Get Process ID
#include <process.h> Required for declarations only
int getpid(void);
getpid() returns the ID of the calling process. The ID is an integer
that uniquely identifies each process.
Returns: ID of calling process.
Notes: The process ID is used by mktemp() to create unique file
names.
-------------------------------- Example ---------------------------------
The following statement prints out the process ID of the current
process.
#include <process.h> /* for 'getpid' */
#include <stdio.h> /* for 'printf' */
main()
{
printf("the process ID = %d\n", getpid());
}
See Also: mktemp()
Online resources provided by: http://www.X-Hacker.org --- NG 2 HTML conversion by Dave Pearson