SETBUF(3) Library Functions Manual SETBUF(3)
NAME
setbuf — assign
buffering to a stream
SYNOPSIS
#include <stdio.h> void setbuf(FILE *stream, char *buf);
DESCRIPTION
Except that it returns no value, the function call:
setbuf(stream, buf)
setvbuf(stream, buf, _IOFBF, BUFSIZ)
if buf is not a null pointer, or to:
setvbuf(stream, buf, _IONBF, BUFSIZ)
if buf is a null pointer.
RETURN VALUE
The setbuf() function returns no value.
ERRORS
No errors are defined.
EXAMPLES
None.
APPLICATION USAGE
A common source of error is allocating buffer space as an "automatic" variable in a code block, and then failing to close the stream in the same block.
With setbuf(), allocating a buffer of BUFSIZ bytes does not necessarily imply that all of BUFSIZ bytes are used for the buffer area.
FUTURE DIRECTIONS
None.
SEE ALSO
fopen(3) , setvbuf(3) , <stdio.h> .
DERIVATION
Derived from Issue 1 of the SVID.
February 1997 posix.fail