You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Linux 4.11 introduced the statx() system call, which allows retrieving
only specific stat fields instead of all of them as in the normal stat(),
which can be beneficial for remote filesystems where collecting *all*
the information might be slower than collecting just some. Moreover,
statx may ask for additional attributes not available with the classic
stat(). Recently, a lot of code, including the Boost library, started
to use statx() instead of stat(), so OSv needs it too.
The implementation in this patch is simple - it just calls stat() and
translates its output (struct stat) into the desired format (struct
statx). As explained in the code, it is ok that we retrieve all the
fields and not just the desired ones - and it's ok if we can't retrieve
more than the original stat() was able to retrive.
With this patch, all OSv unit tests which still failed on Fedora 34
(with the updated Boost that uses statx()) now pass, and "make check"
passes on Fedora 34.
Unfortunately, the Musl header files we use do not declare statx(),
struct statx, or the STATX_* constants, so for now I included these
declarations inside the source file implementing statx(). In the
future, when we update the header files, we can remove those
declarations from the source file.
Fixes#1148
Signed-off-by: Nadav Har'El <nyh@scylladb.com>
Message-Id: <20210621095532.293657-1-nyh@scylladb.com>
0 commit comments