[uClibc] Problem with ttyname

Manuel Novoa III mjn3 at codepoet.org
Tue Jan 13 09:55:15 UTC 2004


Hello,

On Tue, Jan 13, 2004 at 10:35:53AM +0100, Patrick Aussems wrote:
> Erik Andersen wrote:
> >
> >Ok, thats good.  And ttyname now returns 'misc' again?
> > 
> >
> Yes it does. I also connected a serial console to the module and got the 
> following log messages:
> 
> Jan  1 00:00:20 login[35]: unable to determine TTY name, got /dev/misc
> Jan  1 00:00:20 login[35]: root login  on `misc'
> 
> But it works...

No, I don't think it does.  The old (broken) ttyname() code would always
return the address of the internal static buffer.  The new code returns
NULL on error, as is required by SUSv3.

Since the old code returned a value, the tinylogin login app checks that
the value is correct.  When it finds that it isn't, it logs the error
message you report.  The string "/dev/misc" is simply what happens to
be in the ttyname static buffer at the time.

Manuel



More information about the uClibc mailing list