.th write IV 4/21/86
.sh NAME
write - write on a file
.sh SYNOPSIS
write(fildes, buffer, nbytes)
.br
char *buffer;
int fildes, nbytes;
.ft R
.sh DESCRIPTION
A file descriptor is a word returned from a successful open, creat,
dup, pipe, or port call.
.s3
Buffer is the address of nbytes contiguous bytes which are written on
the output file.  The number of characters actually written is
returned.  It should be regarded as an error if this is not the same as
the number requested.
.s3
Writes which are multiples of 512 characters long and begin on a
512-byte boundary in the file are more efficient than any others.
.sh "SEE ALSO"
creat (IV), open (IV), pipe (IV)
.sh DIAGNOSTICS
The error bit (c-bit) is set on an error: bad descriptor, buffer
address, or count; physical I/O errors.  From C, a returned value of
-1 indicates an error.

