3 ms·
stat() takes a pointer to a struct where to write its output. This struct currently has 32bit values for time. If you updated stat() to write 64bit values into
by ProblemFactory 10y ago
stat() takes a pointer to a struct where to write its output. This struct currently has 32bit values for time.
If you updated stat() to write 64bit values into a different struct, any existing program calling it with a pointer to an old struct would get garbage data (and a potential buffer overflow).
Renaming the function also makes debugging easier - after statx() is in widespread use, stat() could be replaced with a placeholder that raises the SIGTRAP signal, and immediately detects epoch-unsafe programs still in use.