Manpage of SETVBUF

Google
Web www.fiveanddime.net

SETVBUF

Section: NEWLIB (3)
Updated: 2005 Feb 23
Index Return to Main Contents
 

NAME

3.43 `setvbuf'--specify file or stream buffering

 

SYNOPSIS


     #include <stdio.h>
     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).

 

PORTABILITY

Both ANSI C and the System V Interface Definition (Issue 2) require `setvbuf'. However, they differ on the meaning of a `NULL' buffer pointer: the SVID issue 2 specification says that a `NULL' buffer pointer requests unbuffered output. For maximum portability, avoid `NULL' buffer pointers.


   Both specifications describe the result on failure only as a nonzero value.


   Supporting OS subroutines required: `close', `fstat', `isatty', `lseek', `read', `sbrk', `write'.

 

SEE ALSO

setvbuf is part of the libc library. The full documentation for libc is maintained as a Texinfo manual. If info and libc are properly installed at your site, the command
info libc

will give you access to the complete manual.


 

Index

NAME
SYNOPSIS
DESCRIPTION
RETURNS
PORTABILITY
SEE ALSO

This document was created by man2html, using the manual pages.
Time: 21:25:31 GMT, May 16, 2005



www.fiveanddime.net








Google
Web www.fiveanddime.net