diff -purN -X /home/mbligh/.diff.exclude 660-gcov_warning_fix/drivers/char/tty_io.c 670-tiocgdev/drivers/char/tty_io.c --- 660-gcov_warning_fix/drivers/char/tty_io.c 2004-02-18 14:56:54.000000000 -0800 +++ 670-tiocgdev/drivers/char/tty_io.c 2004-02-20 15:56:51.000000000 -0800 @@ -1834,6 +1834,21 @@ int tty_ioctl(struct inode * inode, stru case TIOCMBIC: case TIOCMBIS: return tty_tiocmset(tty, file, cmd, arg); + /* + * Without the real device to which /dev/console is connected, + * blogd can not work. + * blogd spawns a pty/tty pair, + * set /dev/console to the tty of that pair (ioctl TIOCCONS), + * then reads in all input from the current /dev/console, + * buffer or write the readed data to /var/log/boot.msg + * _and_ to the original real device. + */ + case TIOCGDEV: + { + unsigned int ret = old_encode_dev(tty_devnum(real_tty)); + return put_user(ret, (unsigned int*) arg); + } + } if (tty->driver->ioctl) { int retval = (tty->driver->ioctl)(tty, file, cmd, arg); diff -purN -X /home/mbligh/.diff.exclude 660-gcov_warning_fix/include/asm-alpha/ioctls.h 670-tiocgdev/include/asm-alpha/ioctls.h --- 660-gcov_warning_fix/include/asm-alpha/ioctls.h 2003-04-09 11:48:05.000000000 -0700 +++ 670-tiocgdev/include/asm-alpha/ioctls.h 2004-02-20 15:56:51.000000000 -0800 @@ -91,6 +91,7 @@ #define TIOCGSID 0x5429 /* Return the session ID of FD */ #define TIOCGPTN _IOR('T',0x30, unsigned int) /* Get Pty Number (of pty-mux device) */ #define TIOCSPTLCK _IOW('T',0x31, int) /* Lock/unlock Pty */ +#define TIOCGDEV _IOR('T',0x32, unsigned int) /* Get real dev no below /dev/console */ #define TIOCSERCONFIG 0x5453 #define TIOCSERGWILD 0x5454 diff -purN -X /home/mbligh/.diff.exclude 660-gcov_warning_fix/include/asm-arm/ioctls.h 670-tiocgdev/include/asm-arm/ioctls.h --- 660-gcov_warning_fix/include/asm-arm/ioctls.h 2003-04-09 11:48:05.000000000 -0700 +++ 670-tiocgdev/include/asm-arm/ioctls.h 2004-02-20 15:56:51.000000000 -0800 @@ -48,6 +48,7 @@ #define TIOCGSID 0x5429 /* Return the session ID of FD */ #define TIOCGPTN _IOR('T',0x30, unsigned int) /* Get Pty Number (of pty-mux device) */ #define TIOCSPTLCK _IOW('T',0x31, int) /* Lock/unlock Pty */ +#define TIOCGDEV _IOR('T',0x32, unsigned int) /* Get real dev no below /dev/console */ #define FIONCLEX 0x5450 /* these numbers need to be adjusted. */ #define FIOCLEX 0x5451 diff -purN -X /home/mbligh/.diff.exclude 660-gcov_warning_fix/include/asm-i386/ioctls.h 670-tiocgdev/include/asm-i386/ioctls.h --- 660-gcov_warning_fix/include/asm-i386/ioctls.h 2003-04-09 11:48:05.000000000 -0700 +++ 670-tiocgdev/include/asm-i386/ioctls.h 2004-02-20 15:56:51.000000000 -0800 @@ -49,6 +49,7 @@ #define TIOCGSID 0x5429 /* Return the session ID of FD */ #define TIOCGPTN _IOR('T',0x30, unsigned int) /* Get Pty Number (of pty-mux device) */ #define TIOCSPTLCK _IOW('T',0x31, int) /* Lock/unlock Pty */ +#define TIOCGDEV _IOR('T',0x32, unsigned int) /* Get real dev no below /dev/console */ #define FIONCLEX 0x5450 #define FIOCLEX 0x5451 diff -purN -X /home/mbligh/.diff.exclude 660-gcov_warning_fix/include/asm-ia64/ioctls.h 670-tiocgdev/include/asm-ia64/ioctls.h --- 660-gcov_warning_fix/include/asm-ia64/ioctls.h 2004-02-04 16:24:28.000000000 -0800 +++ 670-tiocgdev/include/asm-ia64/ioctls.h 2004-02-20 15:56:51.000000000 -0800 @@ -55,6 +55,7 @@ #define TIOCGSID 0x5429 /* Return the session ID of FD */ #define TIOCGPTN _IOR('T',0x30, unsigned int) /* Get Pty Number (of pty-mux device) */ #define TIOCSPTLCK _IOW('T',0x31, int) /* Lock/unlock Pty */ +#define TIOCGDEV _IOR('T',0x32, unsigned int) /* Get real dev no below /dev/console */ #define FIONCLEX 0x5450 /* these numbers need to be adjusted. */ #define FIOCLEX 0x5451 diff -purN -X /home/mbligh/.diff.exclude 660-gcov_warning_fix/include/asm-m68k/ioctls.h 670-tiocgdev/include/asm-m68k/ioctls.h --- 660-gcov_warning_fix/include/asm-m68k/ioctls.h 2003-04-09 11:48:05.000000000 -0700 +++ 670-tiocgdev/include/asm-m68k/ioctls.h 2004-02-20 15:56:51.000000000 -0800 @@ -48,6 +48,7 @@ #define TIOCGSID 0x5429 /* Return the session ID of FD */ #define TIOCGPTN _IOR('T',0x30, unsigned int) /* Get Pty Number (of pty-mux device) */ #define TIOCSPTLCK _IOW('T',0x31, int) /* Lock/unlock Pty */ +#define TIOCGDEV _IOR('T',0x32, unsigned int) /* Get real dev no below /dev/console */ #define FIONCLEX 0x5450 /* these numbers need to be adjusted. */ #define FIOCLEX 0x5451 diff -purN -X /home/mbligh/.diff.exclude 660-gcov_warning_fix/include/asm-mips/ioctls.h 670-tiocgdev/include/asm-mips/ioctls.h --- 660-gcov_warning_fix/include/asm-mips/ioctls.h 2003-07-02 14:44:55.000000000 -0700 +++ 670-tiocgdev/include/asm-mips/ioctls.h 2004-02-20 15:56:51.000000000 -0800 @@ -79,6 +79,7 @@ #define TIOCGSID 0x7416 /* Return the session ID of FD */ #define TIOCGPTN _IOR('T',0x30, unsigned int) /* Get Pty Number (of pty-mux device) */ #define TIOCSPTLCK _IOW('T',0x31, int) /* Lock/unlock Pty */ +#define TIOCGDEV _IOR('T',0x32, unsigned int) /* Get real dev no below /dev/console */ /* I hope the range from 0x5480 on is free ... */ #define TIOCSCTTY 0x5480 /* become controlling tty */ diff -purN -X /home/mbligh/.diff.exclude 660-gcov_warning_fix/include/asm-ppc/ioctls.h 670-tiocgdev/include/asm-ppc/ioctls.h --- 660-gcov_warning_fix/include/asm-ppc/ioctls.h 2003-04-09 11:48:05.000000000 -0700 +++ 670-tiocgdev/include/asm-ppc/ioctls.h 2004-02-20 15:56:51.000000000 -0800 @@ -88,6 +88,7 @@ #define TIOCGSID 0x5429 /* Return the session ID of FD */ #define TIOCGPTN _IOR('T',0x30, unsigned int) /* Get Pty Number (of pty-mux device) */ #define TIOCSPTLCK _IOW('T',0x31, int) /* Lock/unlock Pty */ +#define TIOCGDEV _IOR('T',0x32, unsigned int) /* Get real dev no below /dev/console */ #define TIOCSERCONFIG 0x5453 #define TIOCSERGWILD 0x5454 diff -purN -X /home/mbligh/.diff.exclude 660-gcov_warning_fix/include/asm-ppc64/ioctls.h 670-tiocgdev/include/asm-ppc64/ioctls.h --- 660-gcov_warning_fix/include/asm-ppc64/ioctls.h 2003-04-09 11:48:06.000000000 -0700 +++ 670-tiocgdev/include/asm-ppc64/ioctls.h 2004-02-20 15:56:51.000000000 -0800 @@ -95,6 +95,7 @@ #define TIOCGSID 0x5429 /* Return the session ID of FD */ #define TIOCGPTN _IOR('T',0x30, unsigned int) /* Get Pty Number (of pty-mux device) */ #define TIOCSPTLCK _IOW('T',0x31, int) /* Lock/unlock Pty */ +#define TIOCGDEV _IOR('T',0x32, unsigned int) /* Get real dev no below /dev/console */ #define TIOCSERCONFIG 0x5453 #define TIOCSERGWILD 0x5454 diff -purN -X /home/mbligh/.diff.exclude 660-gcov_warning_fix/include/asm-s390/ioctls.h 670-tiocgdev/include/asm-s390/ioctls.h --- 660-gcov_warning_fix/include/asm-s390/ioctls.h 2003-04-09 11:48:06.000000000 -0700 +++ 670-tiocgdev/include/asm-s390/ioctls.h 2004-02-20 15:56:51.000000000 -0800 @@ -56,6 +56,7 @@ #define TIOCGSID 0x5429 /* Return the session ID of FD */ #define TIOCGPTN _IOR('T',0x30, unsigned int) /* Get Pty Number (of pty-mux device) */ #define TIOCSPTLCK _IOW('T',0x31, int) /* Lock/unlock Pty */ +#define TIOCGDEV _IOR('T',0x32, unsigned int) /* Get real dev no below /dev/console */ #define FIONCLEX 0x5450 /* these numbers need to be adjusted. */ #define FIOCLEX 0x5451 diff -purN -X /home/mbligh/.diff.exclude 660-gcov_warning_fix/include/asm-sh/ioctls.h 670-tiocgdev/include/asm-sh/ioctls.h --- 660-gcov_warning_fix/include/asm-sh/ioctls.h 2003-04-09 11:48:06.000000000 -0700 +++ 670-tiocgdev/include/asm-sh/ioctls.h 2004-02-20 15:56:51.000000000 -0800 @@ -80,6 +80,7 @@ #define TIOCGSID _IOR('T', 41, pid_t) /* 0x5429 */ /* Return the session ID of FD */ #define TIOCGPTN _IOR('T',0x30, unsigned int) /* Get Pty Number (of pty-mux device) */ #define TIOCSPTLCK _IOW('T',0x31, int) /* Lock/unlock Pty */ +#define TIOCGDEV _IOR('T',0x32, unsigned int) /* Get real dev no below /dev/console */ #define TIOCSERCONFIG _IO('T', 83) /* 0x5453 */ #define TIOCSERGWILD _IOR('T', 84, int) /* 0x5454 */ diff -purN -X /home/mbligh/.diff.exclude 660-gcov_warning_fix/include/asm-sparc/ioctls.h 670-tiocgdev/include/asm-sparc/ioctls.h --- 660-gcov_warning_fix/include/asm-sparc/ioctls.h 2003-04-09 11:48:06.000000000 -0700 +++ 670-tiocgdev/include/asm-sparc/ioctls.h 2004-02-20 15:56:51.000000000 -0800 @@ -15,6 +15,7 @@ #define TCSETS _IOW('T', 9, struct termios) #define TCSETSW _IOW('T', 10, struct termios) #define TCSETSF _IOW('T', 11, struct termios) +#define TIOCGDEV _IOR('T',0x32, unsigned int) /* Get real dev no below /dev/console */ /* Note that all the ioctls that are not available in Linux have a * double underscore on the front to: a) avoid some programs to diff -purN -X /home/mbligh/.diff.exclude 660-gcov_warning_fix/include/asm-sparc64/ioctls.h 670-tiocgdev/include/asm-sparc64/ioctls.h --- 660-gcov_warning_fix/include/asm-sparc64/ioctls.h 2003-04-09 11:48:06.000000000 -0700 +++ 670-tiocgdev/include/asm-sparc64/ioctls.h 2004-02-20 15:56:51.000000000 -0800 @@ -16,6 +16,7 @@ #define TCSETS _IOW('T', 9, struct termios) #define TCSETSW _IOW('T', 10, struct termios) #define TCSETSF _IOW('T', 11, struct termios) +#define TIOCGDEV _IOR('T',0x32, unsigned int) /* Get real dev no below /dev/console */ /* Note that all the ioctls that are not available in Linux have a * double underscore on the front to: a) avoid some programs to diff -purN -X /home/mbligh/.diff.exclude 660-gcov_warning_fix/include/asm-x86_64/ioctls.h 670-tiocgdev/include/asm-x86_64/ioctls.h --- 660-gcov_warning_fix/include/asm-x86_64/ioctls.h 2003-04-09 11:48:07.000000000 -0700 +++ 670-tiocgdev/include/asm-x86_64/ioctls.h 2004-02-20 15:56:51.000000000 -0800 @@ -48,6 +48,7 @@ #define TIOCGSID 0x5429 /* Return the session ID of FD */ #define TIOCGPTN _IOR('T',0x30, unsigned int) /* Get Pty Number (of pty-mux device) */ #define TIOCSPTLCK _IOW('T',0x31, int) /* Lock/unlock Pty */ +#define TIOCGDEV _IOR('T',0x32, unsigned int) /* Get real dev no below /dev/console */ #define FIONCLEX 0x5450 /* these numbers need to be adjusted. */ #define FIOCLEX 0x5451