Print

Print


In the latest glibc headers (2.24) the readdir_r and readdir64_r functions have been marked deprecated.

https://sourceware.org/bugzilla/show_bug.cgi?id=19056

Since xrootd uses -Werror, this causes xrootd to fail compilation on system that uses the latest glibc headers.

I found this on what will become Fedora 25. (Yes, Fedora 24 is not yet released, so this is for the release after the next release.)

~~~
/builddir/build/BUILD/xrootd-4.3.0/src/XrdSfs/XrdSfsNative.cc: In member function 'virtual const char* XrdSfsNativeDirectory::nextEntry()':
/builddir/build/BUILD/xrootd-4.3.0/src/XrdSfs/XrdSfsNative.cc:201:16: error: 'int readdir_r(DIR*, dirent*, dirent**)' is deprecated [-Werror=deprecated-declarations]
    if ((retc = readdir_r(dh, d_pnt, &rp)))
                ^~~~~~~~~
In file included from /usr/include/features.h:368:0,
                 from /usr/include/sys/types.h:25,
                 from /builddir/build/BUILD/xrootd-4.3.0/src/XrdSfs/XrdSfsNative.cc:30:
/usr/include/dirent.h:189:12: note: declared here
 extern int __REDIRECT (readdir_r,
            ^
~~~

There are more places that uses the functions in the code than this one.

How should this be solved? The recommendation in the glibc documentation is to use readdir instead of readdir_r, but that is not always guaranteed to be thread safe, and I don't know if something will break if it is used instead.

---
Reply to this email directly or view it on GitHub:
https://github.com/xrootd/xrootd/issues/339

########################################################################
Use REPLY-ALL to reply to list

To unsubscribe from the XROOTD-DEV list, click the following link:
https://listserv.slac.stanford.edu/cgi-bin/wa?SUBED1=XROOTD-DEV&A=1