No empty .Rs/.Re
[netbsd-mini2440.git] / crypto / dist / heimdal / cf / check-getpwnam_r-posix.m4
blob89780b2eab8c6660217b42c1b92d1fc6a39800f4
1 dnl $Heimdal: check-getpwnam_r-posix.m4 15435 2005-06-16 19:45:52Z lha $
2 dnl $NetBSD$
3 dnl
4 dnl check for getpwnam_r, and if it's posix or not
6 AC_DEFUN([AC_CHECK_GETPWNAM_R_POSIX],[
7 AC_FIND_FUNC_NO_LIBS(getpwnam_r,c_r)
8 if test "$ac_cv_func_getpwnam_r" = yes; then
9         AC_CACHE_CHECK(if getpwnam_r is posix,ac_cv_func_getpwnam_r_posix,
10         ac_libs="$LIBS"
11         LIBS="$LIBS $LIB_getpwnam_r"
12         AC_RUN_IFELSE([AC_LANG_SOURCE([[
13 #define _POSIX_PTHREAD_SEMANTICS
14 #include <pwd.h>
15 int main(int argc, char **argv)
17         struct passwd pw, *pwd;
18         return getpwnam_r("", &pw, NULL, 0, &pwd) < 0;
20 ]])],[ac_cv_func_getpwnam_r_posix=yes],[ac_cv_func_getpwnam_r_posix=no],[:])
21 LIBS="$ac_libs")
22 if test "$ac_cv_func_getpwnam_r_posix" = yes; then
23         AC_DEFINE(POSIX_GETPWNAM_R, 1, [Define if getpwnam_r has POSIX flavour.])