Provided by: manpages-zh_1.5.2-1_all bug

NAME

       setbuf, setbuffer, setlinebuf, setvbuf -

SYNOPSIS

       #include <stdio.h>

       void setbuf(FILE *stream, char *buf);
       void setbuffer(FILE *stream, char *buf, size_t size);
       void setlinebuf(FILE *stream);
       int setvbuf(FILE *stream, char *buf, int mode , size_t size);

DESCRIPTION

        ( stdin) fflush(3) ( fclose(3))  I/O malloc(3)  ( stdout ) stderr

        setvbuf mode

              _IONBF

              _IOLBF

              _IOFBF

        buf size buf NULL  read  write setvbuf

        setvbuf setbuf

              setvbuf(stream, buf, buf ? _IOFBF : _IONBF, BUFSIZ);

        setbuffer BUFSIZ setlinebuf

              setvbuf(stream, (char *)NULL, _IOLBF, 0);

RETURN VALUE

         setvbuf   0  It  can return any value on failure, but returns nonzero
       when mode errno

CONFORMING TO

        setbuf setvbuf  ANSI X3.159-1989 (``ANSI C'')

BUGS

        setbuffer setlinebuf  4.2BSD  BSD  Linux  libc 4.5.21  4.2BSD   4.3BSD
       setbuf

        stream buf

       #include <stdio.h>
       int main()
       {
           char buf[BUFSIZ];
           setbuf(stdin, buf);
           printf("Hello, world!\n");
           return 0;
       }

SEE ALSO

       fclose(3), fflush(3), fopen(3), fread(3), malloc(3), printf(3), puts(3)