_getpid

Gets the process identification.

int _getpid( void );

Возвращаемое значение

Returns the process ID obtained from the system. There is no error return.

Заметки

The _getpid function obtains the process ID from the system. The process ID uniquely identifies the calling process.

Требования

Routine

Required header

_getpid

<process.h>

For more compatibility information, see Compatibility in the Introduction.

Пример

// crt_getpid.c
// This program uses _getpid to obtain
// the process ID and then prints the ID.
 

#include <stdio.h>
#include <process.h>

int main( void )
{
   // If run from command line, shows different ID for 
   // command line than for operating system shell.
    
   printf( "Process id: %d\n", _getpid() );
}

Process id: 3584

Эквивалент в .NET Framework

System::Diagnostics::Process::Id

См. также

Основные понятия

Process and Environment Control

_mktemp, _wmktemp