making getpid() function is cross plarform