[ralda at gmx.de: computer phenomena: output of tty applet]

ralda at gmx.de ralda at gmx.de
Tue Apr 3 03:12:56 UTC 2012


Hi Rich!

> Perhaps a more robust solution would be to do this:
> 
> 1. Try /proc if it works.
> 
> 2. Fallback to fstat() to read the major/minor number for stdin, and
> use that to construct a candidate pathname based on standard naming
> rules. stat() the pathname, and if they match, use it.
> 
> 3. Finally (optional; personally I would omit this step because it's
> bloated and ugly) scan /dev for a matching device.

Sure, we can do it in this save way, but isn't it bloat in most usage
cases on Linux? So won't it be a better solution to have that as a
configurable option for uClibc?

What happens if ttyname fails with an error because of an
unavailable /proc? Programms shall usually assume they do not have the
right tty name. In case it is no a tty there is ENOTTY to distinguish
that, if required. otherwise it just says "unknown" (or may be error
prone "not a tty"). Would this simplification break many things? I
ought not so many (there are always some, so never touch ...).

In cases where you know you run on systems without /proc your step #2
and possibly #3 can be enabled in uClibc configuration during install.

--
Harald


More information about the busybox mailing list