AC_CHECK_FUNCS([execvpe])
dnl These are not in POSIX.
AC_CHECK_FUNCS([fwrite_unlocked fputs_unlocked fputc_unlocked])
+dnl Internal functions in libc implementations which must be hooked.
+AC_CHECK_FUNCS([__overflow])
dnl Thanks to gperftools' configure.ac (https://code.google.com/p/gperftools).
AC_MSG_CHECKING([for __builtin_expect])
* part. As writes to stderr are never buffered, __overflow() is always called
* and everything works fine. This is only a problem if stdout is dupped to
* stderr (which shouldn't be the case too often). */
-#ifdef HAVE_STRUCT__IO_FILE__FILENO
+#if defined(HAVE_STRUCT__IO_FILE__FILENO) && defined(HAVE___OVERFLOW)
/* _IO_FILE is glibc's representation of FILE. */
HOOK_FILE2(int, __overflow, f, _IO_FILE *, f, int, ch)
#endif