Added a helper function for writing process' PID.