Borland C++ reference

getpid

raw OCR

Gets the process ID of a program.

Defined in header <process.h>

Syntax

#include <process.h>
unsigned getpid(void)

Portability

DOSUNIXWindowsANSI CC++ only
■■■

Remarks

A process ID uniquely identifies a program. The concept is borrowed from multitasking operating systems like UNIX, where each process is associated with a unique process number.

Return value

getpid returns the segment value of a program's PSP.

See also

Example

#include <stdio.h>
#include <process.h>
int mainO
{
   printfC'This program's process identification number  (PID) "
          "number is %X\n", getpidO);
   printf("Note: under DOS it is the PSP segment\n");
   return 0;
}

Differences from modern implementations

Nothing recorded yet.

Modern references

These are search links, not yet checked by hand.