다음을 통해 공유


_getpid

프로세스 식별자를 가져옵니다.

중요

이 API는 Windows 런타임에서 실행되는 응용 프로그램에서 사용할 수 없습니다.자세한 내용은 /ZW에서 지원하지 않는 CRT 함수를 참조하십시오.

int _getpid( void );

반환 값

시스템에서 얻은 프로세스 ID를 반환 합니다. 반환되는 오류가 없습니다.

설명

_getpid 함수는 시스템에서 프로세스 ID를 가져옵니다. 프로세스 ID는 호출 프로세스를 고유하게 식별합니다.

요구 사항

루틴

필수 헤더

_getpid

<process.h>

호환성 정보에 대한 자세한 내용은 호환성을 참조하십시오.

예제

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

해당 .NET Framework 항목

System::Diagnostics::Process::Id

참고 항목

참조

프로세스 및 환경 제어

_mktemp, _wmktemp