_getpid

프로세스 ID를 가져옵니다.

Important

이 API는 Windows 런타임에서 실행되는 애플리케이션에서 사용할 수 없습니다. 자세한 내용은 유니버설 Windows 플랫폼 앱에서 지원되지 않는 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() );
}
Process id: 3584

참고 항목

프로세스 및 환경 제어
_mktemp, _wmktemp