0d8b67
Use stat64 to detect presence of file that alters IFUNC selection.
0d8b67
This avoids problems in NVMe drives where 32-bit stat would fail
0d8b67
because the device ID doesn't fit into teh truncated 16-bit dev_t.
0d8b67
0d8b67
diff --git a/sysdeps/x86/cpu-features.h b/sysdeps/x86/cpu-features.h
0d8b67
index 4e2e6fabb39ab600..e3b8167ae0669f00 100644
0d8b67
--- a/sysdeps/x86/cpu-features.h
0d8b67
+++ b/sysdeps/x86/cpu-features.h
0d8b67
@@ -184,11 +184,19 @@
0d8b67
 static bool __attribute__ ((unused))
0d8b67
 use_unaligned_strstr (void)
0d8b67
 {
0d8b67
+# if defined __x86_64__
0d8b67
   struct stat unaligned_strstr_etc_sysconfig_file;
0d8b67
+# else
0d8b67
+  struct stat64 unaligned_strstr_etc_sysconfig_file;
0d8b67
+# endif
0d8b67
 
0d8b67
   /* TLS may not have been set up yet, so avoid using stat since it tries to
0d8b67
      set errno.  */
0d8b67
+# if defined __x86_64__
0d8b67
   return INTERNAL_SYSCALL (stat, , 2,
0d8b67
+# else
0d8b67
+  return INTERNAL_SYSCALL (stat64, , 2,
0d8b67
+# endif
0d8b67
 			   ENABLE_STRSTR_UNALIGNED_PATHNAME,
0d8b67
 			   &unaligned_strstr_etc_sysconfig_file) == 0;
0d8b67
 }