next up previous contents
Next: About this document Up: MOSS system calls Previous: unlink: delete a file

write: write to a file

SYNOPSIS

int write(int fd, const void *buf, size_t nbyte);

DESCRIPTION

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).

PARAMETERS

fd
The file descriptor to write from.
buf
The buffer to write data from.
nbyte
The total number of bytes to write.

RETURN VALUE

Returns the actual number of bytes written if successful, or -1 on error, in which case errno indicates the error.



Bryan Ford