views:

93

answers:

2

How can a program on Linux discover the process id of itself? Is there something in /proc/self that will do the trick?

+4  A: 

Try running on your terminal: man getpid

vanza
+11  A: 

getpid(2).

Nikolai N Fetissov
Wonderfully laconic.
Tim Post