diff -upN reference/drivers/char/tty_io.c current/drivers/char/tty_io.c
--- reference/drivers/char/tty_io.c	2004-03-30 10:13:26.000000000 -0800
+++ current/drivers/char/tty_io.c	2004-03-30 13:22:31.000000000 -0800
@@ -1901,6 +1901,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 -upN reference/include/asm-alpha/ioctls.h current/include/asm-alpha/ioctls.h
--- reference/include/asm-alpha/ioctls.h	2003-04-09 11:48:05.000000000 -0700
+++ current/include/asm-alpha/ioctls.h	2004-03-30 13:22:31.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 -upN reference/include/asm-arm/ioctls.h current/include/asm-arm/ioctls.h
--- reference/include/asm-arm/ioctls.h	2003-04-09 11:48:05.000000000 -0700
+++ current/include/asm-arm/ioctls.h	2004-03-30 13:22:31.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 -upN reference/include/asm-i386/ioctls.h current/include/asm-i386/ioctls.h
--- reference/include/asm-i386/ioctls.h	2003-04-09 11:48:05.000000000 -0700
+++ current/include/asm-i386/ioctls.h	2004-03-30 13:22:31.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 -upN reference/include/asm-ia64/ioctls.h current/include/asm-ia64/ioctls.h
--- reference/include/asm-ia64/ioctls.h	2004-02-04 16:24:28.000000000 -0800
+++ current/include/asm-ia64/ioctls.h	2004-03-30 13:22:31.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 -upN reference/include/asm-m68k/ioctls.h current/include/asm-m68k/ioctls.h
--- reference/include/asm-m68k/ioctls.h	2003-04-09 11:48:05.000000000 -0700
+++ current/include/asm-m68k/ioctls.h	2004-03-30 13:22:31.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 -upN reference/include/asm-mips/ioctls.h current/include/asm-mips/ioctls.h
--- reference/include/asm-mips/ioctls.h	2003-07-02 14:44:55.000000000 -0700
+++ current/include/asm-mips/ioctls.h	2004-03-30 13:22:31.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 -upN reference/include/asm-ppc/ioctls.h current/include/asm-ppc/ioctls.h
--- reference/include/asm-ppc/ioctls.h	2003-04-09 11:48:05.000000000 -0700
+++ current/include/asm-ppc/ioctls.h	2004-03-30 13:22:31.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 -upN reference/include/asm-ppc64/ioctls.h current/include/asm-ppc64/ioctls.h
--- reference/include/asm-ppc64/ioctls.h	2003-04-09 11:48:06.000000000 -0700
+++ current/include/asm-ppc64/ioctls.h	2004-03-30 13:22:31.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 -upN reference/include/asm-s390/ioctls.h current/include/asm-s390/ioctls.h
--- reference/include/asm-s390/ioctls.h	2003-04-09 11:48:06.000000000 -0700
+++ current/include/asm-s390/ioctls.h	2004-03-30 13:22:31.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 -upN reference/include/asm-sh/ioctls.h current/include/asm-sh/ioctls.h
--- reference/include/asm-sh/ioctls.h	2003-04-09 11:48:06.000000000 -0700
+++ current/include/asm-sh/ioctls.h	2004-03-30 13:22:31.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 -upN reference/include/asm-sparc/ioctls.h current/include/asm-sparc/ioctls.h
--- reference/include/asm-sparc/ioctls.h	2003-04-09 11:48:06.000000000 -0700
+++ current/include/asm-sparc/ioctls.h	2004-03-30 13:22:31.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 -upN reference/include/asm-sparc64/ioctls.h current/include/asm-sparc64/ioctls.h
--- reference/include/asm-sparc64/ioctls.h	2003-04-09 11:48:06.000000000 -0700
+++ current/include/asm-sparc64/ioctls.h	2004-03-30 13:22:31.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 -upN reference/include/asm-x86_64/ioctls.h current/include/asm-x86_64/ioctls.h
--- reference/include/asm-x86_64/ioctls.h	2003-04-09 11:48:07.000000000 -0700
+++ current/include/asm-x86_64/ioctls.h	2004-03-30 13:22:31.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