bitwiseworks / libc

LIBC Next (kLIBC fork)
9 stars 4 forks source link

Sort out getdirentries mess #27

Closed dmik closed 5 years ago

dmik commented 5 years ago

There is Linux getdents and getdirentries. They are also present in FreeBSD.

kLIBC declares both in dirent.h and provides a backend __libc_Back_ioDirGetEntries for them. However, it only defines a body for getdirents whose signature is like getdents (i.e. only the name differs). This function is not known to Google though (and is absent in any kLIBC header so inaccessible to programs via normal means). It is, however, exported from the LIBC DLL.

This all looks strange and my guess is that there was just a strange mixup when naming it. It should have been getdents and there should also have beemn the getdirentries definiton (which is missing at all). Given that Knut (the author) is completely unresponsive these days, this will remain a guess.

I will fix that by providing the missing definition and by renaming the existing one. We will have to keep the old one though, since it is exported from the DLL. Anyway, this requres #17 to be done as it changes ABI by adding new exports.

This was found when working on #21 (-Wmissing-prototypes).