|
|
1.1 root 1:
2:
3: read() COHERENT System Call read()
4:
5:
6:
7:
8: Read from a file
9:
10: iinntt rreeaadd(_f_d, _b_u_f_f_e_r, _n) iinntt _f_d; cchhaarr *_b_u_f_f_e_r; iinntt _n;
11:
12: read reads up to n bytes of data from the file descriptor fd and
13: writes them into buffer. The amount of data actually read may be
14: less than that requested if read detects EOF. The data are read
15: beginning at the current seek position in the file, which was set
16: by the most recently executed read or lseek routine. read advan-
17: ces the seek pointer by the number of characters read.
18:
19: ***** Example *****
20:
21: For an example of how to use this function, see the entry for
22: open.
23:
24: ***** See Also *****
25:
26: COHERENT system calls, STDIO
27:
28: ***** Diagnostics *****
29:
30: With a successful call, read returns the number of bytes read;
31: thus, zero bytes signals the end of the file. It returns -1 if
32: an error occurs, such as bad file descriptor, bad buffer address,
33: or physical read error.
34:
35: ***** Notes *****
36:
37: read is a low-level call that passes data directly to COHERENT.
38: It should not be intermixed with high-level calls, such as fread,
39: fwrite, or fopen.
40:
41:
42:
43:
44:
45:
46:
47:
48:
49:
50:
51:
52:
53:
54:
55:
56:
57:
58:
59:
60:
61:
62:
63:
64: COHERENT Lexicon Page 1
65:
66:
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.