WritePid() func