Apparently SuSE uses a kernel patch that was rejected by the lkml people which creates a new ioctl called TIOCGDEV. If you're curious, look at the fetchtty code from libconsole.c in the showconsole-1.08 tarball of SuSE's sysvinit package. I believe this was one of the first postings on the subject:
Here are the results of those commands:
~ # inst_pid=$(pidof debian-installer | cut -d" " -f1) $(readlink /proc/$ {inst_pid} /fd/0) ${rawconsole# /dev/} ${console# /dev/}
~ # echo ${inst_pid}
2003
~ # rawconsole=
~ # echo ${rawconsole}
/dev/console
~ # console=$(mapdevfs "$rawconsole")
~ # echo ${console}
/dev/console
~ # rawconsole=
~ # echo ${rawconsole}
console
~ # console=
~ # echo ${console}
console
Apparently SuSE uses a kernel patch that was rejected by the lkml people which creates a new ioctl called TIOCGDEV. If you're curious, look at the fetchtty code from libconsole.c in the showconsole-1.08 tarball of SuSE's sysvinit package. I believe this was one of the first postings on the subject:
http:// lkml.org/ lkml/2000/ 12/15/160
The best my friends and I have come up with that doesn't require a kernel patch is something like the following:
grep "Adding console on ttyS" /var/log/syslog | sed -e "s/^.*console on \(.*\) at .*$/\1/"