3 # Copyright (C) 2005-2007, 2009-2010 Free Software Foundation, Inc.
5 # This file is free software; the Free Software Foundation
6 # gives unlimited permission to copy and/or distribute it,
7 # with or without modifications, as long as this notice is preserved.
11 dnl Provide getlogin_r when the system lacks it.
14 AC_DEFUN([gl_GETLOGIN_R],
16 AC_REQUIRE([gl_UNISTD_H_DEFAULTS])
18 dnl Persuade glibc <unistd.h> to declare getlogin_r().
19 AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS])
21 AC_CHECK_FUNCS_ONCE([getlogin_r])
22 if test $ac_cv_func_getlogin_r = no; then
23 AC_LIBOBJ([getlogin_r])
25 AC_CHECK_DECLS_ONCE([getlogin_r])
26 if test $ac_cv_have_decl_getlogin_r = no; then
27 HAVE_DECL_GETLOGIN_R=0
32 AC_DEFUN([gl_PREREQ_GETLOGIN_R],
34 AC_CHECK_DECLS_ONCE([getlogin])