getpid

De RAD Studio
Aller à : navigation, rechercher

Remonter à Process.h - Index


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



 #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++

+

+