|
|
1.1 root 1: .TH SETBUF 3S
2: .CT 2 file_io
3: .SH NAME
4: setbuf \(mi assign buffering to a stream
5: .SH SYNOPSIS
6: .nf
7: .B #include <stdio.h>
8: .PP
9: .B setbuf(stream, buf)
10: .B FILE *stream;
11: .B char buf[BUFSIZ];
12: .fi
13: .SH DESCRIPTION
14: .I Setbuf
15: is used after a stream has been opened but before it
16: is read or written.
17: It causes the character array
18: .I buf
19: to be used instead of an automatically allocated buffer.
20: If
21: .I buf
22: is the constant pointer
23: .LR NULL ,
24: input/output will be completely unbuffered.
25: .PP
26: A buffer is normally obtained from
27: .IR malloc (3)
28: upon the first
29: .IR getc (3)
30: or
31: .IR putc
32: on the file.
33: Initially,
34: the standard stream
35: .I stderr
36: is unbuffered,
37: and the standard stream
38: .I stdout
39: is flushed automatically
40: whenever new data is read by
41: .IR getc .
42: The latter magic may be dissolved by a call to
43: .IR setbuf .
44: .SH "SEE ALSO"
45: .IR stdio (3),
46: .IR malloc (3)
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.