int write(int fd, const void *buf, size_t nbyte);
This system call implements the POSIX write function, which writes nbyte bytes of data from buf into file descriptor fd.
Note that you cannot write to an embedded file (a file attached to the MOSS executable).
- The file descriptor to write from.
- The buffer to write data from.
- The total number of bytes to write.
Returns the actual number of bytes written if successful, or -1 on error, in which case errno indicates the error.