4 ms·
I recently integrated stdbuf logic in an embedded product. Basically same logic: set the LD_PRELOAD environment variable, taking care to extend LD_PRELOAD if it
by kazinator 4y ago
I recently integrated stdbuf logic in an embedded product. Basically same logic: set the LD_PRELOAD environment variable, taking care to extend LD_PRELOAD if it already has a value.
This was part of an effort to redirect the output of sub-programs such as external command executions and daemons into the application's logging system (fork and capture stdout). Problem is, some things things redirected to a pipe will fully buffer their output so you don't get the output in a timely way.
I noticed that the target system has a libstdbuf.so (even though its rootfs image lacks the stdbuf program) and the rest was history.