Having learned from prior LFS64 experience the glibc developers have
implemented stat in (albeit varying but) neater way:
- declaration with asm linkage to __stat64_time64
- or, `#define stat __stat64_time64`
- or, `#define stat stat64; #define stat64 __stat64_time64`
In all cases __stat64_time64 lacks an explicit declaration, unlike
open64, stat64, fopen64 mentioned earlier.
Since we lack declaration, we have no other option but to check if a
program with reference to __stat64_time64 can link, so we use the
check/has function.
For more details glibc commit
aa03f722f3 ("linux: Add {f}stat{at} y2038
support") added internal.
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Link: https://github.com/kmod-project/kmod/pull/131
Signed-off-by: Lucas De Marchi <lucas.de.marchi@gmail.com>
#####################################################################
AC_CHECK_FUNCS_ONCE(__xstat)
-AC_CHECK_FUNCS_ONCE([open64 stat64 fopen64])
+AC_CHECK_FUNCS_ONCE([open64 stat64 fopen64 __stat64_time64])
AC_CHECK_FUNCS_ONCE([__secure_getenv secure_getenv])
CC_CHECK_FUNC_BUILTIN([__builtin_clz])
_funcs = [
'__xstat',
- 'open64', 'stat64', 'fopen64',
+ 'open64', 'stat64', 'fopen64', '__stat64_time64',
'__secure_getenv', 'secure_getenv',
]
foreach func : _funcs
WRAP_2ARGS(int, -1, stat64, struct stat64*);
#endif
-#if HAVE_DECL___GLIBC__
+#ifdef HAVE___STAT64_TIME64
extern int __stat64_time64 (const char *file, void *buf);
WRAP_2ARGS(int, -1, __stat64_time64, void *);
#endif