THe following script will fail when readdir on a very large filesystem. <?php $path = ...; $res = opendir ( $path ); while ( false !== ( $file = readdir ( $res ) ) ) { print_r($file); } closedir( $res ); ?> Stracing PHP from commandline I get this error: getdents(3, 0x21ddb51c, 32768) = -1 EOVERFLOW (Value too large for defined data type) PHP should use getdents64. In fact, export CPPFLAGS="-D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64" and reinstalling solves the problem. Reproducible: Always Steps to Reproduce: 1.Use PHP on a 32bit system with a very large filesystem 2.Use it and fill the filesystem 3.Use code that use readdir Actual Results: readdir returns false on first iteration, without anything in logs Expected Results: Scanning the directory via readdir https://bugs.php.net/bug.php?id=60666
The Gentoo project distributes source code. The project does not aim to add features or fix bugs in upstream code.