totn C Functions

C Language: setvbuf function
(Set Buffer)

In the C Programming Language, the setvbuf function lets you change the way a stream is buffered and to control the size and location of the buffer.

Syntax

The syntax for the setvbuf function in the C Language is:

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

Parameters or Arguments

stream
The stream to modify.
buf
A pointer to the desired buffer.
mode

It is one of the following:

ModeExplanation
_IOFBFFull buffering
_IOLBFLine buffering
_IONBFNo buffering
size
The number of bytes in the buffer.

Returns

The setvbuf function returns zero if successful or a nonzero value if an error was encountered.

Required Header

In the C Language, the required header for the setvbuf function is:

#include <stdio.h>

Applies To

In the C Language, the setvbuf function can be used in the following versions:

  • ANSI/ISO 9899-1990

Similar Functions

Other C functions that are similar to the setvbuf function:

See Also

Other C functions that are noteworthy when dealing with the setvbuf function: