[PATCH v2 00/18] posix: glob fixes and refactor

Paul Eggert eggert@cs.ucla.edu
Thu Aug 17 19:51:00 GMT 2017


On 08/17/2017 10:32 AM, Adhemerval Zanella wrote:
> My understanding from Florian comment is the 'decoupled' version would be the
> code with both win32/amiga/etc code striped and LIBC defines set to only glibc.
> Would it be acceptable for gnulib?

We don't need Amiga code any more. MS-Windows support is still used, 
though. However, the current style in glob.c with the forest of ifdefs 
is pretty bad, and it'd be good to see it go. Instead, I'd rather have 
the Gnulib-specific stuff put into a section that is relatively 
independent of the rest of the code. To do that, I suggest that you just 
rip out all the MS-Windows code, and I'll do my best to reintroduce it 
in a cleaner way.

> This would also remove the d_ino/d_type abstraction macros.
We'll still need some form of abstraction. For fts.c Gnulib is using 
something like the following, and we could do this sort of thing in 
glob.c too. It's not much of a burden to write 'D_INO (dp)' instead of 
'dp->d_ino' in the mainline code.


#if defined _LIBC || defined D_INO_IN_DIRENT
# define D_INO(dp) (dp)->d_ino
#else
# define D_INO(dp) 0
#endif

By the way, I've lost track: have you looked at the Gnulib fixes for 
glob.c, and merged them into your glibc patch?



More information about the Libc-alpha mailing list