4 ms·
The Linux kernel keeps time as a 64-bit integer, but it's in nanoseconds, not seconds. It's a Y2262 problem.
by mlichvar 2y ago
The Linux kernel keeps time as a 64-bit integer, but it's in nanoseconds, not seconds. It's a Y2262 problem.
- fluoridation 2y agoThat's way easier to fix, though. You just need to fix the kernel's internal structures to keep track of time using two numbers. Y2K was a problem because everyone had to fix their code, not just OSs.
- xboxnolifes 2y agoIt'll still be a problem for code that relies on time being 64-bit int of nanoseconds. How do you change the internal representation here without also breaking the API contract for application code?
- re 2y agoThe kernel does not have an API that exposes that representation to user code; system calls operate on timespec structs struct timespec { time_t tv_sec; /* seconds */ long tv_nsec; /* nanoseconds */ };