/*
* Linux 'readdir' call. This code is mostly taken from the
* SunOS getdents call (see compat/sunos/sunos_misc.c), though
* an attempt has been made to keep it a little cleaner.
*
* The d_off field contains the offset of the next valid entry,
* unless the older Linux getdents(2), which used to have it set
* to the offset of the entry itself. This function also doesn't
* need to deal with the old count == 1 glibc problem.
*
* Read in BSD-style entries, convert them, and copy them out.
*
* Note that this doesn't handle union-mounted filesystems.
*/