The layout of 'struct dirent' in WSL 4.0 uses the time_t type. However, the width of time_t can be either 32 bits or 64 bits, with the latter being the default in WSL 4.0.
Presumably, when the dirent functions were compiled for inclusion in the libmingwex library, the compilation used the 64-bit default definition of time_t.
This means that applications that define
_USE_32BIT_TIME_T will use an incompatible definition of 'struct dirent', which will break any code that calls the dirent functions.
I attach a test program, due to Diego Casorran firstname.lastname@example.org. When compiled with
_USE_32BIT_TIME_T defined, it outputs bogus information.