On Wednesday 19 June 2013 13:05:25 Laurent Bercot wrote:
> >> Busybox lsof used the d_type field of a 'struct dirent' to verify
> >> whether the entry is a symbolic link. This field, however, is not
> >> portable. On at least one board [1] I have seen, that field is 0, and
> >> the check fails even though the entry is a link.
> > 
> > most likely your C library needs updating
> 
>  According to Single Unix v4:
>  http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/dirent.h.html
> the only guaranteed fields on a struct dirent are d_ino and d_name.
> 
>  Until a new release of Single Unix comes out, no libc can be expected
> to use d_type, which is duplicated information anyway.

yes, but that's not what he is complaining about

> > not sure if trying to define a build-time knob to control it would work
> > out well since a number of factors come into play here ...
> 
>  A build-time system check sounds indeed like the right thing to do. What
> kind of factors do you think would make it difficult ?

its existence does not guarantee it will be correctly populated.  in his case, 
he's seeing DT_UNKNOWN in the field which means the lstat fallback is needed.
-mike

Attachment: signature.asc
Description: This is a digitally signed message part.

_______________________________________________
busybox mailing list
[email protected]
http://lists.busybox.net/mailman/listinfo/busybox

Reply via email to