summaryrefslogtreecommitdiff
path: root/tools/include/nolibc/stackprotector.h
diff options
context:
space:
mode:
authorThomas Weißschuh <linux@weissschuh.net>2023-05-27 15:56:42 +0300
committerPaul E. McKenney <paulmck@kernel.org>2023-06-09 21:46:09 +0300
commit87b9fa66af9ad92097c0593626dea3654ec19fd0 (patch)
tree499fa987f15efb7da8cee8b3a6587fd9006d8686 /tools/include/nolibc/stackprotector.h
parent9a75575b81b5639f7ca82c9701fb199401fd6471 (diff)
downloadlinux-87b9fa66af9ad92097c0593626dea3654ec19fd0.tar.xz
tools/nolibc: support nanoseconds in stat()
Keep backwards compatibility through unions. The compatibility macros like #define st_atime st_atim.tv_sec as documented in stat(3type) don't work for nolibc because it would break with other stat-like structures that contain the field st_atime. The stx_atime, stx_mtime, stx_ctime are in type of 'struct statx_timestamp', which is incompatible with 'struct timespec', should be converted explicitly. /* include/uapi/linux/stat.h */ struct statx_timestamp { __s64 tv_sec; __u32 tv_nsec; __s32 __reserved; }; /* include/uapi/linux/time.h */ struct timespec { __kernel_old_time_t tv_sec; /* seconds */ long tv_nsec; /* nanoseconds */ }; Signed-off-by: Thomas Weißschuh <linux@weissschuh.net> Link: https://lore.kernel.org/linux-riscv/3a3edd48-1ace-4c89-89e8-9c594dd1b3c9@t-8ch.de/ Co-authored-by: Zhangjin Wu <falcon@tinylab.org> Signed-off-by: Zhangjin Wu <falcon@tinylab.org> [wt: squashed Zhangjin & Thomas' patches into one to preserve "bisectability"] Signed-off-by: Willy Tarreau <w@1wt.eu> Signed-off-by: Paul E. McKenney <paulmck@kernel.org>
Diffstat (limited to 'tools/include/nolibc/stackprotector.h')
0 files changed, 0 insertions, 0 deletions