[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH v2 3/4] proc: Don't buffer Mach console output

From: Sergey Bugaev
Subject: [PATCH v2 3/4] proc: Don't buffer Mach console output
Date: Mon, 15 May 2023 10:35:59 +0300

Normally glibc does not buffer tty output, but a devstream backed by
the Mach console device cannot be isatty'ed. So we need to ask glibc
explicitly to not buffer it. This is what the startup and mach-defpager
do already.
 proc/main.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/proc/main.c b/proc/main.c
index 8a2dc9ff..747646ef 100644
--- a/proc/main.c
+++ b/proc/main.c
@@ -132,6 +132,7 @@ open_console (mach_port_t device_master)
   stdin = mach_open_devstream (cons, "r");
   stdout = stderr = mach_open_devstream (cons, "w");
+  setbuf (stdout, NULL);
   got_console = 1;
   mach_port_deallocate (mach_task_self (), cons);

reply via email to

[Prev in Thread] Current Thread [Next in Thread]