From 62653059d61eae9c559b514bb126df9e2e845273 Mon Sep 17 00:00:00 2001 From: Eric Andersen Date: Wed, 14 Nov 2001 11:09:46 +0000 Subject: Scrub up some lingering problems preventing readdir64 from working and creating several *64 problems, particualrly when client apps used -D_FILE_OFFSET_BITS=64 -D__USE_FILE_OFFSET64. All better now. -Erik --- libc/misc/dirent/dirstream.h | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) (limited to 'libc/misc/dirent/dirstream.h') diff --git a/libc/misc/dirent/dirstream.h b/libc/misc/dirent/dirstream.h index 8131ffce7..dc5c5732a 100644 --- a/libc/misc/dirent/dirstream.h +++ b/libc/misc/dirent/dirstream.h @@ -24,12 +24,23 @@ Cambridge, MA 02139, USA. */ #define _DIRSTREAM_H 1 +#include #include -#include #ifdef _POSIX_THREADS #include #endif + +#ifdef __UCLIBC_HAVE_LFS__ +#ifndef __USE_LARGEFILE64 +# define __USE_LARGEFILE64 +#endif +# define stuff_t __off64_t +#else +# define stuff_t __off_t +#endif + + /* For now, syscall readdir () only supports one entry at a time. It * will be changed in the future. #define NUMENT 3 @@ -48,19 +59,19 @@ struct __dirstream { int dd_fd; /* offset of the next dir entry in buffer */ - off_t dd_nextloc; + stuff_t dd_nextloc; /* bytes of valid entries in buffer */ - size_t dd_size; + stuff_t dd_size; /* -> directory buffer */ void *dd_buf; /* offset of the next dir entry in directory. */ - off_t dd_nextoff; + stuff_t dd_nextoff; /* total size of buffer */ - size_t dd_max; + stuff_t dd_max; enum {unknown, have_getdents, no_getdents} dd_getdents; -- cgit v1.2.3