fixed it to work on terminals with over 48 lines, and fixed bug
[unix-history] / .ref-BSD-3 / usr / man / man2 / write.2
.TH WRITE 2
.SH NAME
write \- write on a file
.SH SYNOPSIS
.B write(fildes, buffer, nbytes)
.br
.B char *buffer;
.SH DESCRIPTION
A file descriptor is a word returned from a
successful
.I open,
.I creat,
.I dup,
or
.IR pipe (2)
call.
.PP
.I Buffer
is the address of
.I 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 requested.
.PP
Writes which are multiples
of 1024 characters long and begin on a 1024-byte boundary
in the file
are more efficient than any others.
.SH "SEE ALSO"
creat(2), open(2), pipe(2)
.SH DIAGNOSTICS
Returns
\-1 on error: bad descriptor, buffer address, or
count; physical I/O errors.
.SH "ASSEMBLER (PDP-11)"
(write = 4.)
.br
(file descriptor in r0)
.br
.B sys write; buffer; nbytes
.br
(byte count in r0)