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

NAME

6       setbuf - assign buffering to a stream
7

SYNOPSIS

9       #include <stdio.h>
10
11       void setbuf(FILE *restrict stream, char *restrict buf);
12
13

DESCRIPTION

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

RETURN VALUE

33       The setbuf() function shall not return a value.
34

ERRORS

36       No errors are defined.
37
38       The following sections are informative.
39

EXAMPLES

41       None.
42

APPLICATION USAGE

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

RATIONALE

52       None.
53

FUTURE DIRECTIONS

55       None.
56

SEE ALSO

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)
Impressum