MicrOS
setvbuf.c File Reference
#include "../stdio.h"

Functions

int setvbuf (FILE *stream, char *buffer, int mode, size_t size)
 Change stream buffering. More...
 

Function Documentation

◆ setvbuf()

int setvbuf ( FILE stream,
char *  buffer,
int  mode,
size_t  size 
)

Change stream buffering.

Specifies a buffer for stream. The function allows to specify the mode and size of the buffer (in bytes). If buffer is a null pointer, the function automatically allocates a buffer (using size as a hint on the size to use).

Parameters
streamPointer to a FILE object that identifies the stream to be closed.
bufferUser allocated buffer. Shall be at least BUFSIZ bytes long.
modeSpecifies a mode for file buffering (full buffering: _IOFBF, line buffering: _IOLBF, no buffering: _IONBF).
sizeUser allocated buffer. Shall be at least BUFSIZ bytes long.
Returns
If the buffer is correctly assigned to the file, a zero value is returned. Otherwise, a non-zero value is returned.