I have compiled kernel 3.19.1 but still have a problem with time_t. Just a simple program with cout << sizeof (time_t); gives size of 4 bytes, not 8 bytes as was my intention.
Should I switch on a particular option during make menuconfig?
64-bit time support on 32-bit Linux was first introduced in the 5.1 kernel so if you're older than that, sorry. Because changing the return type of the old system calls breaks old applications, new *time64 syscalls had to be added instead. Check this table and you'll see that those syscalls are only available on 32-bit platforms.
Now if you're writing code for 32-bit systems you can call clock_gettime64 directly (from inline assembly, or from C with syscall() function) to get the current time. However after that you're completely on your own. For full userspace support you must be on Linux 5.6 or higher along with musl 1.2+ or glibc 2.32+. Just rebuild your code and time_t will become 64-bit long
All user space must be compiled with a 64-bit
time_t, which will be supported in the coming musl-1.2 and glibc-2.32 releases, along with installed kernel headers from linux-5.6 or higher.Applications that use the system call interfaces directly need to be ported to use the
time64syscalls added in linux-5.1 in place of the existing system calls. This impacts most users offutex()andseccomp()as well as programming languages that have their own runtime environment not based on libc.https://lkml.org/lkml/2020/1/29/355?anz=web
For more information read
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With