WRITE(3spp)
NAME
write − write output
SYNOPSIS
cc = write(d, buf, nbytes)
int cc, d;
char *buf;
int nbytes;
DESCRIPTION
Write attempts to write nbytes of data to the object referenced by the descriptor d from the buffer pointed to by buf.
On objects capable of seeking, the write starts at a position given by the pointer associated with d, see lseek(2). Upon return from write, the pointer is incremented by the number of bytes actually written.
Objects that are not capable of seeking always write from the current position. The value of the pointer associated with such an object is undefined.
RETURN VALUE
Upon successful completion the number of bytes actually written is returned. Otherwise a −1 is returned and the global variable errno is set to indicate the error.