Can anyone guide me as to how to implement a routine in C similar to getpid().