#include <stdio.h> int setvbuf(FILE *file, char *buffer, int type, int length);
This function modifies the buffering characteristics of file.
First, if the file already has a buffer, it is freed. If there was any
pending data in it, it is lost, so this function should only be used
immediately after a call to fopen
.
If the type is _IONBF
, the buffer and length
are ignored and the file is set to unbuffered mode.
If the type is _IOLBF
or _IOFBF
, then the file is
set to line or fully buffered, respectively. If buffer is
NULL
, a buffer of size size is created and used as the
buffer. If buffer is non-NULL
, it must point to a buffer
of at least size size and will be used as the buffer.
See section setbuf. See section setbuffer. See section setlinebuf.
Zero on success, nonzero on failure.
ANSI, POSIX
setvbuf(stderr, NULL, _IOLBF, 1000);
Go to the first, previous, next, last section, table of contents.