From 283cd0eca5b50a77372f2f201acd24cd223db310 Mon Sep 17 00:00:00 2001 From: Adhemerval Zanella Date: Mon, 13 Apr 2020 18:09:20 -0300 Subject: linux: Set internal DIR filepos as off64_t (BZ #23960, BZ #24050) It allows to obtain the expected entry offset on telldir and set it correctly on seekdir on platforms where long int is smaller than off64_t. On such cases opendir creates a map entry between the DIR d_off offset and the returned long int (the telldir return value). seekdir will then set the correct offset from the internal list using the telldir as the list key. It also removes the overflow check on readdir and the returned value will be truncated by the non-LFS off_t size. As Joseph has noted in BZ #23960 comment #22, d_off is an opaque value and since telldir/seekdir works regardless of the returned dirent d_off value. Finally it removes the requirement to check for overflow values on telldir (BZ #24050). Checked on x86_64-linux-gnu, i686-linux-gnu, powerpc-linux-gnu, and arm-linux-gnueabihf. --- include/dirent.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include') diff --git a/include/dirent.h b/include/dirent.h index d7567f5e86..17827176ba 100644 --- a/include/dirent.h +++ b/include/dirent.h @@ -1,8 +1,8 @@ #ifndef _DIRENT_H +# include # ifndef _ISOMAC # include # endif -# include # ifndef _ISOMAC # include # include -- cgit v1.2.3