[Toybox] [PATCH 2/2] dmesg: Line buffering for stdout
Brian Norris
briannorris at google.com
Thu Aug 22 09:15:29 PDT 2024
In one-shot "dump the log" mode, the buffering strategy doesn't matter
too much. But when in "follow" mode (-w or -W), this means we won't
necessarily dump new log message promptly -- we'll wait until we fill
the stdout buffer (currently 4KiB).
Line buffering means we'll print things proactively, as soon as we read
them from kmsg or syslog.
---
toys/lsb/dmesg.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/toys/lsb/dmesg.c b/toys/lsb/dmesg.c
index a29961c9272a..29539af99eef 100644
--- a/toys/lsb/dmesg.c
+++ b/toys/lsb/dmesg.c
@@ -7,7 +7,7 @@
* Linux 6.0 celebrates the 10th anniversary of this being in "testing":
* http://kernel.org/doc/Documentation/ABI/testing/dev-kmsg
-USE_DMESG(NEWTOY(dmesg, "w(follow)W(follow-new)CSTtrs#<1n#c[!Ttr][!Cc][!SWw]", TOYFLAG_BIN))
+USE_DMESG(NEWTOY(dmesg, "w(follow)W(follow-new)CSTtrs#<1n#c[!Ttr][!Cc][!SWw]", TOYFLAG_BIN|TOYFLAG_LINEBUF))
config DMESG
bool "dmesg"
--
2.46.0.184.g6999bdac58-goog
More information about the Toybox
mailing list