* configure.in: Check number of arguments to getpwnam_r and getpwuid_r and
authorKen Raeburn <raeburn@mit.edu>
Fri, 4 Jun 2004 15:46:30 +0000 (15:46 +0000)
committerKen Raeburn <raeburn@mit.edu>
Fri, 4 Jun 2004 15:46:30 +0000 (15:46 +0000)
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
src/include/configure.in

index 4732e1ec83f36ecb5a2aea7b62f71e1017bd0f2b..1f2964d6d1015fff92ff6814eca1ed509e727468 100644 (file)
@@ -1,3 +1,9 @@
+2004-06-04  Ken Raeburn  <raeburn@mit.edu>
+
+       * 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  <raeburn@mit.edu>
 
        * configure.in: Check for getpwnam_r, gmtime_r, and localtime_r.
index 5439cc553f9728dfcb093689dcb488d67942eb89..818398185c6e266d533ac7251b1324b9e67640a9 100644 (file)
@@ -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 <pwd.h>
+   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 <pwd.h>
+   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