1SETBUF(3P)                 POSIX Programmer's Manual                SETBUF(3P)
2
3
4

PROLOG

6       This  manual  page is part of the POSIX Programmer's Manual.  The Linux
7       implementation of this interface may differ (consult the  corresponding
8       Linux  manual page for details of Linux behavior), or the interface may
9       not be implemented on Linux.
10

NAME

12       setbuf - assign buffering to a stream
13

SYNOPSIS

15       #include <stdio.h>
16
17       void setbuf(FILE *restrict stream, char *restrict buf);
18
19

DESCRIPTION

21       Except that it returns no value, the function call:
22
23
24              setbuf(stream, buf)
25
26       shall be equivalent to:
27
28
29              setvbuf(stream, buf, _IOFBF, BUFSIZ)
30
31       if buf is not a null pointer, or to:
32
33
34              setvbuf(stream, buf, _IONBF, BUFSIZ)
35
36       if buf is a null pointer.
37

RETURN VALUE

39       The setbuf() function shall not return a value.
40

ERRORS

42       No errors are defined.
43
44       The following sections are informative.
45

EXAMPLES

47       None.
48

APPLICATION USAGE

50       A common source of error is allocating buffer space as  an  "automatic"
51       variable  in  a code block, and then failing to close the stream in the
52       same block.
53
54       With setbuf(), allocating a buffer of BUFSIZ bytes does not necessarily
55       imply that all of BUFSIZ bytes are used for the buffer area.
56

RATIONALE

58       None.
59

FUTURE DIRECTIONS

61       None.
62

SEE ALSO

64       fopen(),     setvbuf(),     the     Base    Definitions    volume    of
65       IEEE Std 1003.1-2001, <stdio.h>
66
68       Portions of this text are reprinted and reproduced in  electronic  form
69       from IEEE Std 1003.1, 2003 Edition, Standard for Information Technology
70       -- Portable Operating System Interface (POSIX),  The  Open  Group  Base
71       Specifications  Issue  6,  Copyright  (C) 2001-2003 by the Institute of
72       Electrical and Electronics Engineers, Inc and The Open  Group.  In  the
73       event of any discrepancy between this version and the original IEEE and
74       The Open Group Standard, the original IEEE and The Open Group  Standard
75       is  the  referee document. The original Standard can be obtained online
76       at http://www.opengroup.org/unix/online.html .
77
78
79
80IEEE/The Open Group                  2003                           SETBUF(3P)
Impressum