summaryrefslogtreecommitdiff
path: root/proc/main.c
diff options
context:
space:
mode:
Diffstat (limited to 'proc/main.c')
-rw-r--r--proc/main.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/proc/main.c b/proc/main.c
index 7f9157bd..fafbf713 100644
--- a/proc/main.c
+++ b/proc/main.c
@@ -117,6 +117,19 @@ main (int argc, char **argv, char **envp)
mach_port_deallocate (mach_task_self (), pset);
mach_port_deallocate (mach_task_self (), psetcntl);
+ {
+ /* Get our stderr set up to print on the console, in case we have
+ to panic or something. */
+ mach_port_t cons;
+ error_t err;
+ err = device_open (master_device_port, D_READ|D_WRITE, "console", &cons);
+ assert_perror (err);
+ stdin = mach_open_devstream (cons, "r");
+ stdout = stderr = mach_open_devstream (cons, "w");
+ mach_port_deallocate (mach_task_self (), cons);
+ }
+
+
/* wire_task_self (); */
while (1)