int setvbuf(FILE *stream
, char *buffer
Defines how a stream should be buffered. This should be called after the stream has been opened but before any operation has been done on the stream. The argument mode defines how the stream should be buffered as follows:
|Input and output is fully buffered. If the buffer is empty, an input operation attempts to fill the buffer. On output the buffer will be completely filled before any information is written to the file (or the stream is closed).|
|Input and output is line buffered. If the buffer is empty, an input operation attempts to fill the buffer. On output the buffer will be flushed whenever a newline character is written.|
|Input and output is not buffered. No buffering is performed.|
The argument buffer points to an array to be used as the buffer. If buffer is a null pointer, then
malloc to create its own buffer.
The argument size determines the size of the array.
On success zero is returned. On error a nonzero value is returned.