mdev scan
Denys Vlasenko
vda.linux at googlemail.com
Sun Jul 6 06:42:23 UTC 2008
On Sunday 06 July 2008 01:13, Rob Landley wrote:
> On Friday 04 July 2008 17:07:20 Denys Vlasenko wrote:
> > On Friday 04 July 2008 13:39, Holland, John wrote:
> > > Hi,
> > >
> > > I'm having problems scanning usb_endpoint '/dev's on older kernels,
> > > 2.6.13 in particular. The usb_endpoints are beyond the constant
> > > MAX_SYSFS_DEPTH somewhere under /sys.
> >
> > How much is ok on those kernels? 4? 5?
>
> Why is there a MAX_SYSFS_DEPTH? PATH_MAX is 1 page (4096 bytes) and that's
> the size of the buffer I originally allocated...
It's a max depth to recurse, not a buffer size.
> > > The first is to ignore links while traversing,
> >
> > Yeah, pity mdev author forgot to document why ACTION_FOLLOWLINKS
> > is necessary (example would be most useful).
>
> What's ACTION_FOLLOWLINKS? I don't see it in the 1.10.0 util-linux/mdev.c...
Here:
int mdev_main(int argc, char **argv)
{
...
if (argc == 2 && !strcmp(argv[1],"-s")) {
...
recursive_action("/sys/block",
ACTION_RECURSE | ACTION_FOLLOWLINKS,
fileAction, dirAction, temp, 0);
recursive_action("/sys/class",
ACTION_RECURSE | ACTION_FOLLOWLINKS,
fileAction, dirAction, temp, 0);
...
ACTION_FOLLOWLINKS was invented in 1.6.x in order to replace
three bool params of recursive_action() with one bitmask.
> > Now we need to guess whether it's real necessity or just an oversight...
>
> I'm not quite sure what the question was here, or whether or not I'm the
> author you're referring to or somebody who's modified it since, but in
No, the author is vapier:
http://busybox.net/cgi-bin/viewcvs.cgi?rev=18811&view=rev
Looking at it, it seems ACTION_FOLLOWLINKS is a mistake, because
revision 18810 used lstat, not stat.
--
vda
More information about the busybox
mailing list