On Tue, Apr 03, 2012 at 05:12:56AM +0200, [email protected] wrote: > 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?
The issue is not other operating systems. The issue is Linux with missing /proc, e.g. at early boot, in a semi-broken chroot setup, etc. and these are all fairly common in the sort of settings uClibc and busybox tend to be used in. Anyway only option 3 seems like bloat to me (and still not even very much). Options 1 and 2 are pretty light. Rich _______________________________________________ busybox mailing list [email protected] http://lists.busybox.net/mailman/listinfo/busybox
