1 // Copyright 2020 Andrey Semashev 2 3 // Distributed under the Boost Software License, Version 1.0. 4 // See http://www.boost.org/LICENSE_1_0.txt 5 6 // See library home page at http://www.boost.org/libs/filesystem 7 8 #include "platform_config.hpp" 9 10 #include <sys/syscall.h> 11 #include <linux/stat.h> 12 13 // Note: Include other libc headers for stat() as well to ensure there is no conflict between 14 // Linux kernel headers and libc headers. 15 #include <sys/types.h> 16 #include <sys/stat.h> 17 #include <unistd.h> 18 #include <fcntl.h> 19 20 #if !defined(__NR_statx) 21 #error "No statx syscall" 22 #endif 23 main()24int main() 25 { 26 struct statx st; 27 int res = syscall(__NR_statx, AT_FDCWD, ".", AT_SYMLINK_NOFOLLOW | AT_NO_AUTOMOUNT, STATX_BTIME, &st); 28 st.stx_btime.tv_sec = 1; 29 st.stx_btime.tv_nsec = 10; 30 } 31