int setvbuf(FILE *fp, char *buf, int mode, size_t size);
```### Description
Use setvbuf to specify what kind of buffering you want for the file or stream identified by fp, by using one of the following values (from stdio.h) as the mode argument:
_IONBF Do not use a buffer: send output directly to the host system for the file or stream identified by fp.
_IOFBF Use full output buffering: output will be passed on to the host system only when the buffer is full, or when an input operation intervenes.
_IOLBF Use line buffering: pass on output to the host system at every newline, as well as when the buffer is full, or when an input operation intervenes.
Use the size argument to specify how large a buffer you wish. You can supply the buffer itself, if you wish, by passing a pointer to a suitable area of memory as buf. Otherwise, you may pass NULL as the buf argument, and setvbuf will allocate the buffer.### Warnings
You may only use setvbuf before performing any file operation other than opening the file.
If you supply a non-null buf, you must ensure that the associated storage continues to be available until you close the stream identified by fp.### Returns
A 0 result indicates success, EOF failure (invalid mode or size can cause failure).
---
**Authoritative source**: BUSMASTER DITA help source `setvbuf.dita`, compiled into `BUSMASTER.CHM` with the application.