My question is about the write syscall.
I know that if the write was successful, the number of bytes written is stored in rax, but what happens if an error occurs? I want to store -1 in rax in this case.
How can I detect that the the write failed, because of an invalid file descriptor for example.