@Albrecht-S The header of "scandir_posix.c" says:
This implementation of 'scandir()' is intended to be POSIX.1-2008 compliant.
A POSIX.1-1990 compliant system is required as minimum base.
This should be read as "This implementation needs a POSIX.1-1990 API from the operating system".
[OTOH: the reason to provide fl_scandir() is to support systems that lack a POSIX scandir() function. Isn't it to be expected that readdir() is not POSIX compliant on such systems as well?]
No. Back then I have written this scandir() implementation for old versions of Solaris.
They are even POSIX (or UNIX respectively) certified, but for older versions of the standard, that predate scandir().
The problem with this (or any other) approach is how to determine the "broken platform" ...
The simple solution would be:
$ getconf _POSIX_VERSION
200809
If the "getconf" utility is not available, it likely is not Unix.
If it is Unix and it reports at least the value "200809" (POSIX.1-2008), then it should provide a usable scandir().
If it is Unix and it reports at least the value "199009" (POSIX.1-1990), then it should provide a usable readdir().
I would not expect a POSIX conformant API from an operating system like DOS or Windows at all.
That existing functions may have the same names says nothing about their behaviour.
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or unsubscribe.
[ Direct Link to Message ] |