A wrapper for the statx syscall. Disable MSAN since at least on clang 10 it doesn't know which fields of struct statx are initialized by the syscall and misdetects errors.
| 395 | //! A wrapper for the statx syscall. Disable MSAN since at least on clang 10 it doesn't |
| 396 | //! know which fields of struct statx are initialized by the syscall and misdetects errors. |
| 397 | BOOST_FILESYSTEM_NO_SANITIZE_MEMORY |
| 398 | int statx_syscall(int dirfd, const char* path, int flags, unsigned int mask, struct ::statx* stx) |
| 399 | { |
| 400 | int res = ::syscall(__NR_statx, dirfd, path, flags, mask, stx); |
| 401 | if (res < 0) |
| 402 | { |
| 403 | const int err = errno; |
| 404 | if (BOOST_UNLIKELY(err == ENOSYS)) |
| 405 | { |
| 406 | filesystem::detail::atomic_store_relaxed(statx_ptr, &statx_fstatat); |
| 407 | return statx_fstatat(dirfd, path, flags, mask, stx); |
| 408 | } |
| 409 | } |
| 410 | |
| 411 | return res; |
| 412 | } |
| 413 | |
| 414 | #endif // defined(BOOST_FILESYSTEM_HAS_STATX) |
| 415 |
nothing calls this directly
no test coverage detected