RAD Studio |  |

getpid

Header File

process.h

Category

Process Control Routines

Prototype

unsigned getpid(void)

Description

Gets the process ID of a program.

This function returns the current process ID--an integer that uniquely identifies the process.

Return Value

getpid returns the current process' ID.

Example

Copy Code

    #include <stdio.h>
    #include <process.h>
    int main()
    {
       printf("This program's process identification number (PID) "
              "number is %X\n", getpid());
       printf("Note: under DOS it is the PSP segment\n");
       return 0;
    }

Portability

POSIX | Win32 | ANSI C | ANSI C++
+ | + |  |

Copyright(C) 2009 Embarcadero Technologies, Inc. All Rights Reserved.
What do you think about this topic? Send feedback!