www.delorie.com/djgpp/doc/libc-2.01/libc_580.html   search  
Go to the first, previous, next, last section, table of contents.


setvbuf

Syntax

#include <stdio.h>

int setvbuf(FILE *file, char *buffer, int type, int length);

Description

This function modifies the buffering characteristics of file. First, if the file already has a buffer, it is freed. If there was any pending data in it, it is lost, so this function should only be used immediately after a call to fopen.

If the type is _IONBF, the buffer and length are ignored and the file is set to unbuffered mode.

If the type is _IOLBF or _IOFBF, then the file is set to line or fully buffered, respectively. If buffer is NULL, a buffer of size size is created and used as the buffer. If buffer is non-NULL, it must point to a buffer of at least size size and will be used as the buffer.

See section setbuf. See section setbuffer. See section setlinebuf.

Return Value

Zero on success, nonzero on failure.

Example

setbuf(stderr, NULL, _IOLBF, 1000);


Go to the first, previous, next, last section, table of contents.

  prev next   webmaster     delorie software   privacy  
  Copyright © 1997     Updated Apr 1997