From 9ce357fb689307118db60112b155da179292ba9b Mon Sep 17 00:00:00 2001 From: Roland McGrath Date: Sun, 23 May 1999 17:35:15 +0000 Subject: 1999-05-23 Roland McGrath * main.c (main): Set up console on stderr. --- proc/main.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'proc/main.c') 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) -- cgit v1.2.3