#include <stdio.h>
#include <stdlib.h>
#include <locale.h>
+#ifdef __GLIBC__
+#include <dlfcn.h>
+#endif
/* Explicit HACK */
{
int i_ret;
+# ifdef __GLIBC__
+ if (dlsym (RTLD_NEXT, "sync_file_range"))
+ {
+ /* Way too many Linux users have glibc 2.6 that keeps crashing
+ * inside its non-thread-safe dcgettext(). */
+ fprintf (stderr,
+"***************************************************\n"
+"*** glibc version with broken libintl detected. ***\n"
+"*** Messages localization will be disabled. ***\n"
+"***************************************************\n");
+ setenv ("LC_MESSAGES", "C", 1);
+ }
+# endif
setlocale (LC_ALL, "");
#ifndef __APPLE__