Skip to content

LD_PRELOAD library for controlling standard stream buffer sizes.

License

Notifications You must be signed in to change notification settings

DMOJ/setbufsize.so

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

setbufsize.so Linux Build Status

LD_PRELOAD library for controlling standard stream buffer sizes.

You can grab prebuilt 32- and 64-bit binaries from the Releases tab. These are built by Travis on a CentOS 5 Docker image, so they should "just work" on any Linux distribution newer than that.

Example Usage

For instance, if you wished to set the stdout of a program app to be unbuffered when connected to a terminal (rather than the default line-buffering), the invocation would be:

$ LD_PRELOAD=/path/to/setbufsize64.so STDOUT_BUFFER_SIZE=0 ./app

STDERR_BUFFER_SIZE does the obvious thing, for stderr.

Caveats

Due to its nature as an LD_PRELOAD object, setbufsize requires the target program to use libc for its output, and furthermore be dynamically linked.