Use getmypid() if POSIX function isn't available