tech-kern archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: Getting the device name from a struct tty *



        hello.  You should be able to find what you need by getting the unit
number from the dev_t element, there's a macro for that in C, but I don't
know about Lua.  Alternatively, you should be able to parse it from the
dev_xname field of one of the fields of the struct dev you're passed.  (I
think the name of the device is somewhere in there too and can be combined
with the unit value referred to above.)

-Brian

On Oct 15,  9:09am, Marc Balmer wrote:
} Subject: Getting the device name from a struct tty *
} In a tty line discipline, I want to get the name of the tty driver
} instance, e.g. "dtyU0".  The line disciplines are called with a "struct
} tty *" as argument, is there any (halfway sane) way to get at the name
} of the driver instance?  I need the name of the instance, not only the
} name of the driver.
} 
} "struct tty *" contains a "dev_t" element, fwiw.
} 
} Is that possible?
>-- End of excerpt from Marc Balmer




Home | Main Index | Thread Index | Old Index