Warning: main(/www/www/htdocs/style/globals.php) [function.main]: failed to open stream: No such file or directory in /www/www/docs/6.4.1/neutrino/lib_ref/s/setlinebuf.html on line 1
Warning: main() [function.include]: Failed opening '/www/www/htdocs/style/globals.php' for inclusion (include_path='.:/www/www/common:/www/www/php/lib/php') in /www/www/docs/6.4.1/neutrino/lib_ref/s/setlinebuf.html on line 1
Warning: main(/www/www/htdocs/style/header.php) [function.main]: failed to open stream: No such file or directory in /www/www/docs/6.4.1/neutrino/lib_ref/s/setlinebuf.html on line 8
Warning: main() [function.include]: Failed opening '/www/www/htdocs/style/header.php' for inclusion (include_path='.:/www/www/common:/www/www/php/lib/php') in /www/www/docs/6.4.1/neutrino/lib_ref/s/setlinebuf.html on line 8
Assign line buffering to a stream
#include <unix.h>
int setlinebuf( FILE *iop );
- iop
- The stream that you want to use line buffering.
libc
Use the -l c option to
qcc
to link against this library.
This library is usually included automatically.
The setbuffer()
and setlinebuf() functions assign
buffering to a stream. The types of buffering available are:
- Unbuffered
- Information appears on the destination file or terminal as soon
as written.
- Block-buffered
- Many characters are saved and written as a block.
- Line-buffered
- Characters are saved until either a newline is encountered or input
is read from stdin.
You can use
fflush()
to force the block out early.
Normally all files are block-buffered. A buffer is
obtained from
malloc()
when the first
getc()
or
putc()
is performed on the file. If the standard stream stdout refers
to a terminal, it's line-buffered. The standard stream
stderr is unbuffered by default.
You can use setlinebuf() to change the buffering on
a stream from block-buffered or unbuffered to line-buffered.
Unlike setbuffer(),
you can call setlinebuf() at any time that the stream
iop is active.
You can use
freopen().
to change a stream from unbuffered or line-buffered to block buffered.
To change a stream from block-buffered or line-buffered to unbuffered,
call freopen(), and then call
setbuf()
with a buffer argument of NULL.
No useful value.
Unix
Safety: | |
Cancellation point |
No |
Interrupt handler |
No |
Signal handler |
No |
Thread |
Yes |
fclose(),
fflush(),
fopen(),
fread(),
freopen(),
getc(),
malloc(),
printf(),
putc(),
puts(),
setbuf(),
setbuffer(),
setvbuf()
Warning: main(/www/www/htdocs/style/footer.php) [function.main]: failed to open stream: No such file or directory in /www/www/docs/6.4.1/neutrino/lib_ref/s/setlinebuf.html on line 171
Warning: main() [function.include]: Failed opening '/www/www/htdocs/style/footer.php' for inclusion (include_path='.:/www/www/common:/www/www/php/lib/php') in /www/www/docs/6.4.1/neutrino/lib_ref/s/setlinebuf.html on line 171