466
|
1 <refentry id="setbuf">
|
|
2 <refnamediv>
|
527
|
3 <refname>Setbuf</refname>
|
|
4 <refpurpose>fix file buffer</refpurpose>
|
466
|
5 </refnamediv>
|
|
6
|
|
7 <refsynopsisdiv>
|
|
8 <funcsynopsis>
|
468
|
9 <funcsynopsisinfo>
|
|
10 #include <stdio.h>
|
|
11 </funcsynopsisinfo>
|
466
|
12 <funcprototype>
|
|
13 <funcdef><function>setbuf</function></funcdef>
|
527
|
14 <paramdef>FILE *<parameter>fp</parameter></paramdef>
|
|
15 <paramdef>char *<parameter>buffer</parameter></paramdef>
|
466
|
16 </funcprototype>
|
|
17 </funcsynopsis>
|
|
18
|
|
19 </refsynopsisdiv>
|
|
20
|
|
21 <refsect1><title>Description</title>
|
|
22 <para>
|
527
|
23 When the first character is written to or read from a file
|
|
24 after it has been opened by "fopen()", a buffer is obtained
|
|
25 from the system if required and assigned to it. Setbuf may be
|
|
26 used to forestall this by assigning a user buffer to the file.
|
|
27 </para>
|
|
28 <para>
|
|
29 Setbuf must be used after the file has been opened and before
|
|
30 any I/O has taken place.
|
|
31 </para>
|
|
32 <para>
|
|
33 The buffer must be of sufficient size and a value for a
|
|
34 manifest constant, BUFSIZ, is defined in the header file for
|
|
35 use in declarations.
|
|
36 </para>
|
|
37 <para>
|
|
38 If the "buffer" argument is NULL (0), the file becomes unbuffered
|
|
39 and characters are read or written singly.
|
|
40 </para>
|
|
41 <para>
|
|
42 NOTE that the standard error output is unbuffered and the
|
|
43 standard output is buffered.
|
|
44 </para>
|
|
45 </refsect1>
|
|
46 <refsect1><title>See Also</title>
|
|
47 <para>
|
|
48 fopen(),getc(),putc()
|
466
|
49 </para>
|
|
50 </refsect1>
|
|
51 </refentry>
|
527
|
52 </refentry>
|