getpid {fork}R Documentation

Obtain the process id for the current process.

Description

Obtain the process number for the current process.

Usage

getpid()

Details

This function is a simple wrapper around the Unix "getpid" function call.

Value

Integer process id.

Author(s)

Gregory R. Warnes greg@random-technologies-llc.com

References

Unix "getpid" man page

See Also

fork, exit, wait, kill, killall

Examples


getpid()

## Not run: 
for(i in 1:10)
  fork( function() { cat("PID:", getpid(), "\n"); exit()} )
## End(Not run)

[Package fork version 1.2.1 Index]