Well the title pretty much sums the question. The only thing I found is this but I\'m not sure if thats the way to go.
I have not tried in non Windows based systems. perhaps the PID divisibility by 4 will provide a clue More info on this PID propery here : About the pid of the process
and here http://blogs.msdn.com/oldnewthing/archive/2008/02/28/7925962.aspx