setvbuf()

alter buffering behavior of stream 

Function


SYNOPSIS

#include <stdio.h>

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


DESCRIPTION

The setvbuf() function lets the program control the buffer of a given stream. This function may be used after the stream pointed to by stream is associated with an open file, but before any other operation is performed on the stream. If buffer is not a NULL pointer, the array it points to is used instead of a buffer allocated by setvbuf().


PARAMETERS

stream 

Points to a FILE structure.

buffer 

Is the user-allocated buffer.

mode 

Is the mode of buffering which may be one of the following:

_IOFBF 

Causes input/output to be fully buffered.

_IOLBF 

Causes input/output to be line buffered.

_IONBF 

Causes input/output to be unbuffered.

size 

Is the size of the buffer.


RETURN VALUES

If successful, setvbuf() returns 0. On failure, it returns non-zero if an invalid value is given for mode or if the request cannot be honored.


CONFORMANCE

ANSI/ISO 9899-1990.


MULTITHREAD SAFETY LEVEL

MT-Safe.


PORTING ISSUES

None.


AVAILABILITY

MKS Toolkit for Professional Developers
MKS Toolkit for Enterprise Developers
MKS Toolkit for Enterprise Developers 64-Bit Edition


SEE ALSO

Functions:
setbuf()


MKS Toolkit 9.2 Documentation Build 16.