1SETBUF(P) POSIX Programmer's Manual SETBUF(P)
2
3
4
6 setbuf - assign buffering to a stream
7
9 #include <stdio.h>
10
11 void setbuf(FILE *restrict stream, char *restrict buf);
12
13
15 Except that it returns no value, the function call:
16
17
18 setbuf(stream, buf)
19
20 shall be equivalent to:
21
22
23 setvbuf(stream, buf, _IOFBF, BUFSIZ)
24
25 if buf is not a null pointer, or to:
26
27
28 setvbuf(stream, buf, _IONBF, BUFSIZ)
29
30 if buf is a null pointer.
31
33 The setbuf() function shall not return a value.
34
36 No errors are defined.
37
38 The following sections are informative.
39
41 None.
42
44 A common source of error is allocating buffer space as an "automatic"
45 variable in a code block, and then failing to close the stream in the
46 same block.
47
48 With setbuf(), allocating a buffer of BUFSIZ bytes does not necessarily
49 imply that all of BUFSIZ bytes are used for the buffer area.
50
52 None.
53
55 None.
56
58 fopen() , setvbuf() , the Base Definitions volume of
59 IEEE Std 1003.1-2001, <stdio.h>
60
62 Portions of this text are reprinted and reproduced in electronic form
63 from IEEE Std 1003.1, 2003 Edition, Standard for Information Technology
64 -- Portable Operating System Interface (POSIX), The Open Group Base
65 Specifications Issue 6, Copyright (C) 2001-2003 by the Institute of
66 Electrical and Electronics Engineers, Inc and The Open Group. In the
67 event of any discrepancy between this version and the original IEEE and
68 The Open Group Standard, the original IEEE and The Open Group Standard
69 is the referee document. The original Standard can be obtained online
70 at http://www.opengroup.org/unix/online.html .
71
72
73
74IEEE/The Open Group 2003 SETBUF(P)