Let stdio do the buffering when writing a NUL-terminated string
Add error checking
Have fatal error report include where the error is being reported
Handle child exit gracefully
Mark syscall_occurred as volatile

The parent process can (and does) change it from outside of the normal
flow of execution
Handle EINTR and short writes for write()