this repo has no description
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Open a dserver console socket when opening "/dev/console"

This allows log messages that programs want to write to "/dev/console"
to be written to darlingserver's log stream instead. The alternative is
to just drop those messages, because "/dev/console" a privileged device
(plus, we don't want to be writing to Linux kernel's console anyways).

+14 -2
+14 -2
src/kernel/emulation/linux/fcntl/openat.c
··· 3 3 #include "../base.h" 4 4 #include "../errno.h" 5 5 #include <linux-syscalls/linux.h> 6 - #include <lkm/api.h> 7 - #include <mach/lkm.h> 8 6 #include "../../../../libc/include/fcntl.h" 9 7 #include "../common_at.h" 10 8 #include "../simple.h" 11 9 #include "../vchroot_expand.h" 12 10 #include "../bsdthread/cancelable.h" 11 + 12 + #include <darlingserver/rpc.h> 13 13 14 14 #ifndef O_NOFOLLOW 15 15 # define O_NOFOLLOW 0x0100 ··· 49 49 // Expected by launchd and CF 50 50 else if (strcmp(filename, "/dev/autofs_nowait") == 0) 51 51 filename = "/dev/null"; 52 + else if (strcmp(filename, "/dev/console") == 0) { 53 + // redirect console output to darlingserver 54 + int err = dserver_rpc_console_open(&ret); 55 + if (err < 0) { 56 + __simple_printf("dserver_rpc_console_open failed internally: %d", err); 57 + __simple_abort(); 58 + } 59 + if (err > 0) { 60 + ret = errno_linux_to_bsd(-err); 61 + } 62 + return ret; 63 + } 52 64 53 65 struct vchroot_expand_args vc; 54 66 vc.flags = (flags & BSD_O_SYMLINK || flags & BSD_O_NOFOLLOW) ? 0 : VCHROOT_FOLLOW;