])# PGAC_FUNC_GETTIMEOFDAY_1ARG
-# PGAC_FUNC_GETPWUID_R_5ARG
-# ---------------------------
-# Check if getpwuid_r() takes a fifth argument (later POSIX standard, not draft version)
-# If so, define GETPWUID_R_5ARG
-AC_DEFUN([PGAC_FUNC_GETPWUID_R_5ARG],
-[AC_CACHE_CHECK(whether getpwuid_r takes a fifth argument,
-pgac_cv_func_getpwuid_r_5arg,
-[AC_TRY_COMPILE([#include <sys/types.h>
-#include <pwd.h>],
-[uid_t uid;
-struct passwd *space;
-char *buf;
-size_t bufsize;
-struct passwd **result;
-getpwuid_r(uid, space, buf, bufsize, result);],
-[pgac_cv_func_getpwuid_r_5arg=yes],
-[pgac_cv_func_getpwuid_r_5arg=no])])
-if test x"$pgac_cv_func_getpwuid_r_5arg" = xyes ; then
- AC_DEFINE(GETPWUID_R_5ARG, 1,
- [Define to 1 if getpwuid_r() takes a 5th argument.])
-fi
-])# PGAC_FUNC_GETPWUID_R_5ARG
-
-
# PGAC_FUNC_STRERROR_R_INT
# ---------------------------
# Check if strerror_r() returns an int (SUSv3) rather than a char * (GNU libc)
# Do test here with the proper thread flags
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether getpwuid_r takes a fifth argument" >&5
-$as_echo_n "checking whether getpwuid_r takes a fifth argument... " >&6; }
-if ${pgac_cv_func_getpwuid_r_5arg+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-#include <sys/types.h>
-#include <pwd.h>
-int
-main ()
-{
-uid_t uid;
-struct passwd *space;
-char *buf;
-size_t bufsize;
-struct passwd **result;
-getpwuid_r(uid, space, buf, bufsize, result);
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
- pgac_cv_func_getpwuid_r_5arg=yes
-else
- pgac_cv_func_getpwuid_r_5arg=no
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv_func_getpwuid_r_5arg" >&5
-$as_echo "$pgac_cv_func_getpwuid_r_5arg" >&6; }
-if test x"$pgac_cv_func_getpwuid_r_5arg" = xyes ; then
-
-$as_echo "#define GETPWUID_R_5ARG 1" >>confdefs.h
-
-fi
-
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether strerror_r returns int" >&5
$as_echo_n "checking whether strerror_r returns int... " >&6; }
if ${pgac_cv_func_strerror_r_int+:} false; then :
AC_CHECK_FUNCS([strerror_r getpwuid_r gethostbyname_r])
# Do test here with the proper thread flags
-PGAC_FUNC_GETPWUID_R_5ARG
PGAC_FUNC_STRERROR_R_INT
CFLAGS="$_CFLAGS"
reference if 'false' */
#undef FLOAT8PASSBYVAL
-/* Define to 1 if getpwuid_r() takes a 5th argument. */
-#undef GETPWUID_R_5ARG
-
/* Define to 1 if gettimeofday() takes only 1 argument. */
#undef GETTIMEOFDAY_1ARG
(--enable-thread-safety) */
#define ENABLE_THREAD_SAFETY 1
-/* Define to 1 if getpwuid_r() takes a 5th argument. */
-/* #undef GETPWUID_R_5ARG */
-
/* Define to 1 if gettimeofday() takes only 1 argument. */
/* #undef GETTIMEOFDAY_1ARG */
/*
* Wrapper around getpwuid() or getpwuid_r() to mimic POSIX getpwuid_r()
- * behaviour, if it is not available or required.
+ * behaviour, if that function is not available or required.
*
* Per POSIX, the possible cases are:
* success: returns zero, *result is non-NULL
size_t buflen, struct passwd ** result)
{
#if defined(FRONTEND) && defined(ENABLE_THREAD_SAFETY) && defined(HAVE_GETPWUID_R)
-
-#ifdef GETPWUID_R_5ARG
- /* POSIX version */
return getpwuid_r(uid, resultbuf, buffer, buflen, result);
-#else
-
- /*
- * Early POSIX draft of getpwuid_r() returns 'struct passwd *'.
- * getpwuid_r(uid, resultbuf, buffer, buflen)
- */
- errno = 0;
- *result = getpwuid_r(uid, resultbuf, buffer, buflen);
- /* paranoia: ensure we return zero on success */
- return (*result == NULL) ? errno : 0;
-#endif
#else
/* no getpwuid_r() available, just use getpwuid() */
errno = 0;