linux/tools/include/nolibc
Thomas Weißschuh d5094bcb5b tools/nolibc: define time_t in terms of __kernel_old_time_t
Nolibc assumes that the kernel ABI is using a time values that are as
large as a long integer. For most ABIs this holds true.
But for x32 this is not correct, as it uses 32bit longs but 64bit times.

Also the 'struct stat' implementation of nolibc relies on timespec::tv_sec
and time_t being the same type. While timespec::tv_sec comes from the
kernel and is of type __kernel_old_time_t, time_t is defined within nolibc.

Switch to the __kernel_old_time_t to always get the correct type.

Signed-off-by: Thomas Weißschuh <linux@weissschuh.net>
Link: https://lore.kernel.org/r/20250712-nolibc-x32-v1-1-6d81cb798710@weissschuh.net
Acked-by: Willy Tarreau <w@1wt.eu>
2025-07-13 16:58:34 +02:00
..
sys tools/nolibc: avoid false-positive -Wmaybe-uninitialized through waitpid() 2025-07-07 15:24:35 +02:00
.gitignore tools/nolibc: Add gitignore to avoid git complaints about sysroot 2023-03-20 08:45:21 -07:00
arch-arm64.h tools/nolibc: use arm64 name over aarch64 2025-06-24 09:46:52 +02:00
arch-arm.h tools/nolibc: drop manual stack pointer alignment 2025-04-14 07:51:25 +02:00
arch-loongarch.h tools/nolibc: drop manual stack pointer alignment 2025-04-14 07:51:25 +02:00
arch-m68k.h tools/nolibc: Add m68k support 2025-05-21 15:31:54 +02:00
arch-mips.h tools/nolibc: MIPS: add support for N64 and N32 ABIs 2025-06-28 22:23:33 +02:00
arch-powerpc.h tools/nolibc: drop manual stack pointer alignment 2025-04-14 07:51:25 +02:00
arch-riscv.h tools/nolibc: drop manual stack pointer alignment 2025-04-14 07:51:25 +02:00
arch-s390.h tools/nolibc: don't use asm/ UAPI headers 2025-03-08 13:18:27 +01:00
arch-sh.h tools/nolibc: add support for SuperH 2025-07-04 13:26:07 +02:00
arch-sparc.h tools/nolibc: Provide vfork() 2025-07-04 13:26:12 +02:00
arch-x86.h tools/nolibc: merge i386 and x86_64 into a single x86 arch 2025-06-22 09:16:07 +02:00
arch.h tools/nolibc: add support for SuperH 2025-07-04 13:26:07 +02:00
compiler.h tools/nolibc: add __nolibc_aligned() and __nolibc_aligned_as() 2025-04-19 14:17:52 +02:00
crt.h tools/nolibc: disable function sanitizer for _start_c() 2025-04-19 14:17:56 +02:00
ctype.h tools/nolibc: include nolibc.h early from all header files 2025-05-21 15:31:50 +02:00
dirent.h tools/nolibc: include nolibc.h early from all header files 2025-05-21 15:31:50 +02:00
elf.h tools/nolibc: include nolibc.h early from all header files 2025-05-21 15:31:50 +02:00
errno.h tools/nolibc: include nolibc.h early from all header files 2025-05-21 15:31:50 +02:00
fcntl.h tools/nolibc: include nolibc.h early from all header files 2025-05-21 15:31:50 +02:00
getopt.h tools/nolibc: include nolibc.h early from all header files 2025-05-21 15:31:50 +02:00
limits.h tools/nolibc: add limits.h shim header 2025-03-03 20:00:12 +01:00
Makefile tools/nolibc: drop s390 clang target override 2025-07-08 09:24:00 +02:00
math.h tools/nolibc: add abs() and friends 2025-05-21 15:32:05 +02:00
nolibc.h tools/nolibc: move uname() and friends to sys/utsname.h 2025-05-21 15:32:24 +02:00
poll.h tools/nolibc: use poll-related definitions from UAPI headers 2025-05-21 15:32:00 +02:00
sched.h tools/nolibc: add namespace functionality 2025-05-21 15:32:12 +02:00
signal.h tools/nolibc: include nolibc.h early from all header files 2025-05-21 15:31:50 +02:00
stackprotector.h tools/nolibc: add prototypes for non-static functions 2025-02-03 20:57:37 +01:00
std.h tools/nolibc: define time_t in terms of __kernel_old_time_t 2025-07-13 16:58:34 +02:00
stdarg.h tools/nolibc: add stdarg.h header 2023-10-12 21:13:52 +02:00
stdbool.h tools/nolibc: add stdbool.h header 2024-07-29 07:52:57 +02:00
stddef.h tools/nolibc: move NULL and offsetof() to sys/stddef.h 2025-05-21 15:32:25 +02:00
stdint.h tools/nolibc: use intmax definitions from compiler 2025-04-22 10:56:24 +02:00
stdio.h selftests/nolibc: correctly report errors from printf() and friends 2025-07-06 11:02:40 +02:00
stdlib.h tools/nolibc: add abs() and friends 2025-05-21 15:32:05 +02:00
string.h tools/nolibc: add strstr() 2025-05-21 15:32:00 +02:00
sys.h tools/nolibc: Provide vfork() 2025-07-04 13:26:12 +02:00
time.h tools/nolibc: add support for clock_nanosleep() and nanosleep() 2025-07-06 11:02:38 +02:00
types.h tools/nolibc: fix spelling of FD_SETBITMASK in FD_* macros 2025-06-22 09:14:22 +02:00
unistd.h tools/nolibc: add support for access() and faccessat() 2025-05-21 15:32:06 +02:00