Process with id 1 not writing even though it's pid is being gotten my the system call getpid()