Remove configure test for nonstandard variants of getpwuid_r().

We had code that supposed that some platforms might offer a nonstandard
version of getpwuid_r() with only four arguments.  However, the 5-argument
definition has been standardized at least since the Single Unix Spec v2,
which is our normal reference for what's portable across all Unix-oid
platforms.  (What's more, this wasn't the only pre-standardization version
of getpwuid_r(); my old HPUX 10.20 box has still another signature.)
So let's just get rid of the now-useless configure step.
This commit is contained in:
Tom Lane 2015-01-11 12:52:37 -05:00
parent 080eabe2e8
commit 8883bae33b
6 changed files with 1 additions and 83 deletions

View File

@ -79,30 +79,6 @@ AH_VERBATIM(GETTIMEOFDAY_1ARG_,
])# 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)

37
configure vendored
View File

@ -12632,43 +12632,6 @@ done
# 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 :

View File

@ -1527,7 +1527,6 @@ fi
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"

View File

@ -74,9 +74,6 @@
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

View File

@ -62,9 +62,6 @@
(--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 */

View File

@ -82,7 +82,7 @@ pqStrerror(int errnum, char *strerrbuf, size_t buflen)
/*
* 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
@ -96,21 +96,7 @@ pqGetpwuid(uid_t uid, struct passwd * resultbuf, char *buffer,
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;