check for getpwnam_r, and if it's posix or not

git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@5719 ec53bebd-3082-4978-b11e-865c3cabbd6b
This commit is contained in:
Johan Danielsson
1999-03-23 16:31:21 +00:00
parent 7102ff04c9
commit b8e69eaecc

View File

@@ -0,0 +1,24 @@
dnl $Id
dnl
dnl check for getpwnam_r, and if it's posix or not
AC_DEFUN(AC_CHECK_GETPWNAM_R_POSIX,
AC_FIND_FUNC_NO_LIBS(getpwnam_r,c_r)
if test "$ac_cv_func_getpwnam_r" = yes; then
AC_CACHE_CHECK(if getpwnam_r is posix,ac_cv_func_getpwnam_r_posix,
ac_libs="$LIBS"
LIBS="$LIBS $LIB_getpwnam_r"
AC_TRY_RUN([
#include <pwd.h>
int main()
{
struct passwd pw, *pwd;
return getpwnam_r("", &pw, NULL, 0, &pwd) < 0;
}
],ac_cv_func_getpwnam_r_posix=yes,ac_cv_func_getpwnam_r_posix=no,:)
LIBS="$ac_libs")
if test "$ac_cv_func_getpwnam_r_posix" = yes; then
AC_DEFINE(POSIX_GETPWNAM_R, 1, [Define if getpwnam_r has POSIX flavour.])
fi
fi
)