summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergey Bugaev <bugaevc@gmail.com>2023-05-15 10:35:59 +0300
committerSamuel Thibault <samuel.thibault@ens-lyon.org>2023-05-15 18:32:32 +0200
commit89d7c97ce5dfca6f54bc1a10577638d94518b0e9 (patch)
treefd3f4ea505b01a96d4c11bf8f44d4474f02315cd
parent0e6a671b828b28b186822f0a2125272781b84c28 (diff)
proc: Don't buffer Mach console output
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. Message-Id: <20230515073600.1350072-3-bugaevc@gmail.com>
-rw-r--r--proc/main.c1
1 files changed, 1 insertions, 0 deletions
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);