Unix to Windows Porting Dictionary for HPC

RSS

Links

Function List

getpid


Unix

header file: unistd.h

pid_t getpid(void);

Windows

header file: process.h

int _getpid(void);

Purpose

This function returns the process ID of the calling process.

Discussion

Since this function has a direct analog in Windows, the only changes that should be needed are to rename the function in your source code, and include the needed Windows header file.

Example of Use in Windows

#include <process.h>

  printf("The process ID is %d.", _getpid());
  
blog comments powered by Disqus
Valid HTML 4.01 Transitional Valid CSS!