From 6a6daa318ddbd6ed2b8a39948d66c8b5ac882532 Mon Sep 17 00:00:00 2001 From: Ken Raeburn Date: Fri, 4 Jun 2004 15:46:30 +0000 Subject: [PATCH] * configure.in: Check number of arguments to getpwnam_r and getpwuid_r and define some new macros if they're the four-argument draft POSIX versions. git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@16407 dc483132-0cff-0310-8789-dd5450dbe970 --- src/include/ChangeLog | 6 ++++++ src/include/configure.in | 27 +++++++++++++++++++++++++++ 2 files changed, 33 insertions(+) diff --git a/src/include/ChangeLog b/src/include/ChangeLog index 4732e1ec8..1f2964d6d 100644 --- a/src/include/ChangeLog +++ b/src/include/ChangeLog @@ -1,3 +1,9 @@ +2004-06-04 Ken Raeburn + + * configure.in: Check number of arguments to getpwnam_r and + getpwuid_r and define some new macros if they're the + four-argument draft POSIX versions. + 2004-06-03 Ken Raeburn * configure.in: Check for getpwnam_r, gmtime_r, and localtime_r. diff --git a/src/include/configure.in b/src/include/configure.in index 5439cc553..818398185 100644 --- a/src/include/configure.in +++ b/src/include/configure.in @@ -49,6 +49,33 @@ if test "$ac_cv_func_gethostbyname_r" = yes; then fi ]) dnl + +if test "$ac_cv_func_getpwnam_r" = yes; then + AC_MSG_CHECKING([number of arguments to getpwnam_r]) + AC_CACHE_VAL(krb5_cv_getpwnam_r_args, + [AC_TRY_COMPILE([#include + struct passwd pwx; char buf[1024];], + [getpwnam_r("", &pwx, buf, sizeof(buf));], + krb5_cv_getpwnam_r_args=4,krb5_cv_getpwnam_r_args=5)]) + AC_MSG_RESULT($krb5_cv_getpwnam_r_args) + if test "$krb5_cv_getpwnam_r_args" = 4; then + AC_DEFINE(GETPWNAM_R_4_ARGS,1,[Define if getpwnam_r exists but takes only 4 arguments (e.g., POSIX draft 6 implementations like some Solaris releases).]) + fi +fi + +if test "$ac_cv_func_getpwuid_r" = yes; then + AC_MSG_CHECKING([number of arguments to getpwuid_r]) + AC_CACHE_VAL(krb5_cv_getpwuid_r_args, + [AC_TRY_COMPILE([#include + struct passwd pwx; char buf[1024];], + [getpwuid_r(0, &pwx, buf, sizeof(buf));], + krb5_cv_getpwuid_r_args=4,krb5_cv_getpwuid_r_args=5)]) + AC_MSG_RESULT($krb5_cv_getpwuid_r_args) + if test "$krb5_cv_getpwuid_r_args" = 4; then + AC_DEFINE(GETPWUID_R_4_ARGS,1,[Define if getpwuid_r exists but takes only 4 arguments (e.g., POSIX draft 6 implementations like some Solaris releases).]) + fi +fi + AC_CHECK_FUNC(getservbyname_r,[ ac_cv_func_getservbyname_r=yes if test "$ac_cv_func_getservbyname_r" = yes; then -- 2.26.2