Skip to content

XrdPosix fails to compile with glibc 2.33 (2.32.9000) #1315

@ellert

Description

@ellert
/builddir/build/BUILD/xrootd-5.0.2/src/XrdPosix/XrdPosix.cc: In function 'int XrdPosix_Fstat(int, stat*)':
/builddir/build/BUILD/xrootd-5.0.2/src/XrdPosix/XrdPosix.cc:379:27: error: '_STAT_VER' was not declared in this scope
  379 |           : Xunix.Fstat64(_STAT_VER, fildes, (struct stat64 *)buf));
      |                           ^~~~~~~~~
/builddir/build/BUILD/xrootd-5.0.2/src/XrdPosix/XrdPosix.cc: In function 'int XrdPosix_Lstat(const char*, stat*)':
/builddir/build/BUILD/xrootd-5.0.2/src/XrdPosix/XrdPosix.cc:563:27: error: '_STAT_VER' was not declared in this scope
  563 |           ? Xunix.Lstat64(_STAT_VER, path, (struct stat64 *)buf)
      |                           ^~~~~~~~~
/builddir/build/BUILD/xrootd-5.0.2/src/XrdPosix/XrdPosix.cc: In function 'int XrdPosix_Stat(const char*, stat*)':
/builddir/build/BUILD/xrootd-5.0.2/src/XrdPosix/XrdPosix.cc:891:26: error: '_STAT_VER' was not declared in this scope
  891 |           ? Xunix.Stat64(_STAT_VER, path, (struct stat64 *)buf)
      |                          ^~~~~~~~~

In glibc 2.32 and earlier _STAT_VER is defined in /usr/include/sys/stat.h (which includes /usr/include/bits/stat.h). However, in glibc 2.33 this define is dropped. The headers no longer redirects the calls to the kernel functions, but there are implementations in glibc.

I do not know how to fix this, is it sufficient to do

#ifndef _STAT_VER
#define _STAT_VER <some value> /* What value? */
#endif

Or does it need morc complicates changes?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions