GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages
LIBSTDBUF(3) FreeBSD Library Functions Manual LIBSTDBUF(3)

libstdbuf
preloaded library to change standard streams initial buffering

The 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 environment variables.

Each stream can be configured independently through the following environment variables (values are defined below):
Initial buffering definition for the standard input stream
Initial buffering definition for the standard output stream
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)

In 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.

The libstdbuf library first appeared in FreeBSD 8.4.

The original idea of the libstdbuf command comes from Padraig Brady who implemented it in the GNU coreutils. Jeremie Le Hen implemented it on FreeBSD.
April 28, 2012 FreeBSD 13.1-RELEASE

Search for    or go to Top of page |  Section 3 |  Main Index

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with ManDoc.