setvbuf
- Updated2023-02-21
- 2 minute(s) read
setvbuf
int setvbuf (FILE *stream, char buffer[], int bufferingMode, size_t bufferSize);
Purpose
Specifies how to buffer the I/O stream. The mode of the stream can be set to full buffering, line buffering, or no buffering. If no buffer is specified, the system dynamically allocates one.
Parameters
Input | ||||||||||||||
Name | Type | Description | ||||||||||||
stream | FILE * | Contains a pointer to the stream that has its buffering mode specified. This stream must be associated with an open file with no operations performed on it for the function to work correctly. | ||||||||||||
bufferingMode | int |
Specifies the desired buffering mode for the stream. The following gives a description of the selections available:
|
||||||||||||
bufferSize | size_t | Contains the size of the buffer that is used for the specified stream. If the input to buffer is not NULL, the value input to this parameter must be less than or equal to the number of bytes in the specified buffer. | ||||||||||||
Output | ||||||||||||||
Name | Type | Description | ||||||||||||
buffer | char [] |
Contains a pointer to the I/O buffer that is used. If NULL is entered into this parameter, this function dynamically allocates
the specified size. The contents of this buffer at any time are indeterminate.
|
Return Value
Name | Type | Description |
status | int | Contains the resulting status of the function. If successful, setvbuf returns 0. If an error occurs, setvbuf returns a nonzero value and sets errno to a nonzero value. |
Additional Information
Library: ANSI C Library
Include file: ansi_c.h
LabWindows/CVI compatibility: LabWindows/CVI 3.0 and later