Hi Mark, On Aug 30 00:29, Mark Geisert via Cygwin-apps wrote: > [redirected from the main Cygwin ML] > Corinna Vinschen via Cygwin wrote: > > This is not what I meant. A simple reproducer is ideally a piece of > > C code which shows ;the problem with a minimum of code. In this case, > > a pice of C code with the #includes required to reproduce the compiler > > failing is what I'm looking for. > [...] > From this I discovered that pthread_attr_t and pthread_t defs are missing > because sys/_pthreadtypes.h includes sys/cpuset.h which starts a whole > include chain ending up in sys/signal.h where the defs are needed. Note > they are defined in sys/_pthreadtypes.h where we started, but haven't been > seen yet because sys/cpuset.h has gone off on this detour. > > Similarly, the timestruc_t def is missing because sys/_pthreadtypes.h again > starts an include chain that ends up in sys/stat.h where the def is needed. > Note timestruc_t is defined in machine/types.h, which is included (by > sys/types.h) after sys/_pthreadtypes.h, so the def hasn't been seen yet > because of a similar detour. > > The fix I'm considering is to > (1) move sys/_pthreadtypes.h's "#include sys/cpuset.h" to just before its > final #endif, and > (2) exchange the positions of "#include " and "#include > " within sys/types.h. > I could submit for review a patch to do these things. > > An alternative would be to somehow massage the coreutils build > include-file-wrapping to accomplish the same end. I personally don't have > the time or skills to figure that out. I have another solution, based on how Linux does it, see the attached patch. What do you think? If that's ok with you, I'll push it. Thanks, Corinna