-AC_DEFUN([gl_GETLOGIN_R],
-[
- AC_REPLACE_FUNCS([getlogin_r])
+ dnl Persuade glibc <unistd.h> to declare getlogin_r().
+ dnl Persuade Solaris <unistd.h> to provide the POSIX compliant declaration of
+ dnl getlogin_r().
+ AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS])
+
+ AC_CHECK_FUNCS_ONCE([getlogin_r])