Commit | Line | Data |
---|---|---|
6de44978 KT |
1 | .TH WRITE 2 |
2 | .SH NAME | |
3 | write \- write on a file | |
4 | .SH SYNOPSIS | |
5 | .B write(fildes, buffer, nbytes) | |
6 | .br | |
7 | .B char *buffer; | |
8 | .SH DESCRIPTION | |
9 | A file descriptor is a word returned from a | |
10 | successful | |
11 | .I open, | |
12 | .I creat, | |
13 | .I dup, | |
14 | or | |
15 | .IR pipe (2) | |
16 | call. | |
17 | .PP | |
18 | .I Buffer | |
19 | is the address of | |
20 | .I nbytes | |
21 | contiguous | |
22 | bytes which are written on the output file. | |
23 | The number of characters actually written is returned. | |
24 | It should be regarded as an error | |
25 | if this is not the same as requested. | |
26 | .PP | |
27 | Writes which are multiples | |
28 | of 512 characters long and begin on a 512-byte boundary | |
29 | in the file | |
30 | are more efficient than any others. | |
31 | .SH "SEE ALSO" | |
32 | creat(2), open(2), pipe(2) | |
33 | .SH DIAGNOSTICS | |
34 | Returns | |
35 | \-1 on error: bad descriptor, buffer address, or | |
36 | count; physical I/O errors. | |
37 | .SH ASSEMBLER | |
38 | (write = 4.) | |
39 | .br | |
40 | (file descriptor in r0) | |
41 | .br | |
42 | .B sys write; buffer; nbytes | |
43 | .br | |
44 | (byte count in r0) |