Li-Guangda
Li-Guangda

Reputation: 361

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 ?

Upvotes: 0

Views: 67

Answers (1)

KamilCuk
KamilCuk

Reputation: 141768

"/* 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/[email protected]/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.

Upvotes: 1

Related Questions