readdir() failures on libc5
| From: | Stanislav Malyshev | Date: | Thu, 07 Sep 2000 17:05:17 +0000 |
| Subject: | readdir() failures on libc5 | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-32585@lists.php.net to get a copy of this message | ||
With help of Johan Ekenberg, I've found the source for readdir failures -
readdir_r in libc5 fails when third argument points to value that equals
0. Don't ask me why. This code (slightly modified aclocal's
one) reproduces it:
main() {
DIR *dir;
struct dirent entry, *pentry=NULL;
dir = opendir("/");
if (!dir)
exit(1);
if (readdir_r(dir, &entry, &pentry) == 0)
exit(0);
exit(1);
}
It will return "1" on libc5.
Now, the question is - what to do? Insert a hack in dir.c or modify
configure so that it will detect this situation? Also, if the latter - how
to do it right, can aclocal checks be modified?
--
Stanislav Malyshev stas@zend.com http://www.zend.com/
+972-3-6139665 ext.106