Search code examples
linuxioctl

What does macro TIOCGDEV mean?


I am reading source code under Linux and reach this function:

ioctl (fd, TIOCGDEV, &devnum)

But I don't find the document about the macro TIOCGDEV from man page, what does this macro mean ?


Solution

  • "/* Get real dev no below /dev/console */"

    "The TIOCGDEV ioctl is a hack written to allow bootup messages to be display both on the screen and also to be logged"

    "Without the real device to which /dev/console is connected, blogd can not work."

    https://www.mail-archive.com/pld-cvs-commit@lists.pld-linux.org/msg230185.html
    https://elixir.bootlin.com/linux/latest/source/drivers/tty/tty_io.c#L2747
    https://arstechnica.com/civis/viewtopic.php?f=16&t=477204
    https://opensuse.opensuse.narkive.com/DRN6tZW3/sle-tiocgdev-patches-for-new-kernels

    I believe nowadays we have journald from systemd.