This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] posix: if glob has a trailing slash match directories only.


Dmitry Goncharov wrote:
Paul, i am missing where you see the performance hit.
The current contract makes the caller check after the library by calling stat
on each entry.

No, these callers need not call stat. glob itself doesn't call stat, when it calls itself recursively with this flag. Instead, glob simply charges ahead and gets an ENOTDIR (or whatever( in the next level of recursion. For this sort of usage, it is a win for glob to filter out directories if that is easy (because there is then no need even to issue the syscalls that result in ENOTDIR), but it can be a loss for glob to filter out directories via stat calls.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]