This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH v2] Fix 32-bit getcwd() on filesystems with 64-bit inodes.
On 27 Feb 2018, Adhemerval Zanella outgrape:
> On 26/02/2018 20:38, Nick Alcock wrote:
>> getcwd() is used in the dynamic linker as part of $ORIGIN support, so
>> the usual SHLIB_COMPAT dance is needed there to prevent versioned symbols
>> getting into it and causing disaster.
>
> We usually add where we actually tested the patch on commit message,
> so if you may please add the explanation you wrote before about the
> XFS inode limitations along where you actually tested (for instance
> 'checked on x86_64-linux-gnu').
Will add.
>> diff --git a/sysdeps/unix/sysv/linux/i386/readdir64.c b/sysdeps/unix/sysv/linux/i386/readdir64.c
>> index 42b73023e0..e2981c7f9c 100644
>> --- a/sysdeps/unix/sysv/linux/i386/readdir64.c
>> +++ b/sysdeps/unix/sysv/linux/i386/readdir64.c
>> @@ -28,19 +28,21 @@
>> #undef DIRENT_TYPE
>>
>> libc_hidden_def (__readdir64)
>> +#if IS_IN (libc)
>> versioned_symbol (libc, __readdir64, readdir64, GLIBC_2_2);
>>
>> -#if SHLIB_COMPAT(libc, GLIBC_2_1, GLIBC_2_2)
>> +# if SHLIB_COMPAT(libc, GLIBC_2_1, GLIBC_2_2)
>
> The indentation is done with one extra space.
We are already inside one level of #if here: #ifndef _DIRENT_H at the
top. There is a probable error there: # ifndef _ISOMAC is followed by
no identation change at all, so frankly I have no *idea* what level is
appropriate. Perhaps two, perhaps three, certainly not one.
>>
>> -#include <olddirent.h>
>> +# include <olddirent.h>
>>
>> -#define __READDIR attribute_compat_text_section __old_readdir64
>> -#define __GETDENTS __old_getdents64
>> -#define DIRENT_TYPE struct __old_dirent64
>> +# define __READDIR attribute_compat_text_section __old_readdir64
>> +# define __GETDENTS __old_getdents64
>> +# define DIRENT_TYPE struct __old_dirent64
>>
>> -#include <sysdeps/posix/readdir.c>
>> +# include <sysdeps/posix/readdir.c>
>>
>> libc_hidden_def (__old_readdir64)
>>
>> compat_symbol (libc, __old_readdir64, readdir64, GLIBC_2_1);
>> #endif
>> +#endif
>
> Ok with the removal of the extra space.
this is a double-level of #if, too, though the indentation on the
innermost #if itself, and on its corresponding #endif, is wrong: will
fix.
--
NULL && (void)