Looking at man 2 write:
"On error, -1 is returned, and errno is set appropriately."
But if write(2) just fail, it makes nonsense to write an error message right after…
maybe i should write an error message on stderr or maybe just exit() on the first write error?
What do you think?
In a typical command line program, error messages should always be written to
stderr, that’s what it’s for.