How can i implement a routine similar to getpid function by using the C header files.