*traditionally*, you openned /dev/tty, did an fstat(), and the kernel filled in the real major/minor numbers for the tty you had; then you scanned /dev/ (or wherever depending on how creative your system was) and stat'ed things until you got a matching major/minor device number. (ttyname did all this; you only generally noticed when debugging something with a syscall tracer...)
-- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]