[ First ]  [ Previous ]  [ Next ]  [ Last ]  [ Manuals ]


getpid

Retrieve the process identification number.

Compatibility:

This function is compatible with the following targets:

ANSI

BeOS

EMB/RTOS

Mac OS

Palm OS

Win32


Prototype:
#include <unistd.h>
getpid() Macros:

Macro

Represents
#define getpid()  
 
Process ID  
#define getppid()  
 
Parent process ID  
#define getuid()  
 
Real user ID  
#define geteuid()  
 
Effective user ID  
#define getgid()  
 
Real group ID  
#define getegid()  
 
Effective group ID  
#define getpgrp()  
 
Process group ID  

Parameters:

None

Remarks:

The getpid() function returns the unique number (Process ID) for the calling process. Example of usage is given in "Example of getpid() usage."

Return:

getpid() returns an integer value.


NOTE

These various related getpid() type functions don't really have any meaning on the Mac. The values returned are those that would make sense for a typical user process under UNIX.
Return:

getpid() always returns a value. There is no error returned.

Example of getpid() usage.:
#include <stdio.h>
#include <unistd.h>

int main(void) 
{
  printf("The process ID is %d\n", getpid()); 

	return 0;
}

Result
The process ID is 9000


[ First ]  [ Previous ]  [ Next ]  [ Last ]  [ Manuals ]

Visit the Metrowerks website at: http://www.metrowerks.com
For assistance contact Metrowerks Technical Support at: cw_support@metrowerks.com
Copyright © 2000, Metrowerks Corp. All rights reserved.

Last updated: August 16, 2000