_getpid

Ottiene l'id processo.

Nota importanteImportante

Questa API non può essere utilizzata nelle applicazioni che vengono eseguite in Windows Runtime.Per ulteriori informazioni, vedere Funzioni CRT non supportate con /ZW.

int _getpid( void );

Valore restituito

Restituisce l'id processo ottenuto dal sistema.Nessun ritorno di errore.

Note

La funzione di _getpid ottiene l'id processo dal sistema.L'id processo identifica in modo univoco il processo chiamante.

Requisiti

Routine

Intestazione obbligatoria

_getpid

<process.h>

Per ulteriori informazioni sulla compatibilità, vedere Compatibilità nell'introduzione.

Esempio

// 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() );
}
  

Equivalente .NET Framework

System::Diagnostics::Process::Id

Vedere anche

Riferimenti

Processo e controllo ambiente

_mktemp, _wmktemp