Query: libstdbuf
OS: freebsd
Section: 3
Format: Original Unix Latex Style Formatted with HTML and a Horizontal Scroll Bar
LIBSTDBUF(3) BSD Library Functions Manual LIBSTDBUF(3)NAMElibstdbuf -- preloaded library to change standard streams initial bufferingDESCRIPTIONThe libstdbuf library is meant to be preloaded with the LD_PRELOAD environment variable to as to change the initial buffering of standard input, standard output and standard error streams. Although you may load and configure this library manually, an utility, stdbuf(1), can be used to run a command with the appropriate environ- ment variables.ENVIRONMENTEach stream can be configured independently through the following environment variables (values are defined below): _STDBUF_I Initial buffering definition for the standard input stream _STDBUF_O Initial buffering definition for the standard output stream _STDBUF_E Initial buffering definition for the standard error stream Each variable may take one of the following values: "0" unbuffered "L" line buffered "B" fully buffered with the default buffer size size fully buffered with a buffer of size bytes (suffixes 'k', 'M' and 'G' are accepted)EXAMPLEIn the following example, the stdout stream of the awk(1) command will be fully buffered by default because it does not refer to a terminal. libstdbuf is used to force it to be line-buffered so vmstat(8)'s output will not stall until the full buffer fills. # vmstat 1 | LD_PRELOAD=/usr/lib/libstdbuf.so STDBUF_1=L awk '$2 > 1 || $3 > 1' | cat -n See also the manpage of stdbuf(1) for a simpler way to do this.HISTORYThe libstdbuf library first appeared in FreeBSD 8.4.AUTHORSThe original idea of the libstdbuf command comes from Padraig Brady who implemented it in the GNU coreutils. Jeremie Le Hen implemented it on FreeBSD.BSDApril 28, 2012 BSD
Related Man Pages |
---|
setlinebuf(3s) - ultrix |
stdbuf(1) - freebsd |
libstdbuf(3) - freebsd |
stdbuf(1) - plan9 |
stdbuf(1) - x11r4 |
Similar Topics in the Unix Linux Community |
---|
how to display date along with vmstat |
awk output to variables |
Discussion on buffering of standard I/O library |
How to assign a value to a variable in awk scripting? |
Using variable output in awk |