SCCS-vsn: lib/libc/gen/scandir.c 5.5
*/
#if defined(LIBC_SCCS) && !defined(lint)
*/
#if defined(LIBC_SCCS) && !defined(lint)
-static char sccsid[] = "@(#)scandir.c 5.4 (Berkeley) %G%";
+static char sccsid[] = "@(#)scandir.c 5.5 (Berkeley) %G%";
#endif /* LIBC_SCCS and not lint */
/*
#endif /* LIBC_SCCS and not lint */
/*
#include <sys/stat.h>
#include <dirent.h>
#include <sys/stat.h>
#include <dirent.h>
+/*
+ * The DIRSIZ macro gives the minimum record length which will hold
+ * the directory entry. This requires the amount of space in struct dirent
+ * without the d_name field, plus enough space for the name with a terminating
+ * null byte (dp->d_namlen+1), rounded up to a 4 byte boundary.
+ */
+#undef DIRSIZ
+#define DIRSIZ(dp) \
+ ((sizeof (struct dirent) - (MAXNAMLEN+1)) + (((dp)->d_namlen+1 + 3) &~ 3))
+
scandir(dirname, namelist, select, dcomp)
char *dirname;
struct dirent *(*namelist[]);
scandir(dirname, namelist, select, dcomp)
char *dirname;
struct dirent *(*namelist[]);