Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit8883bae

Browse files
committed
Remove configure test for nonstandard variants of getpwuid_r().
We had code that supposed that some platforms might offer a nonstandardversion of getpwuid_r() with only four arguments. However, the 5-argumentdefinition has been standardized at least since the Single Unix Spec v2,which is our normal reference for what's portable across all Unix-oidplatforms. (What's more, this wasn't the only pre-standardization versionof getpwuid_r(); my old HPUX 10.20 box has still another signature.)So let's just get rid of the now-useless configure step.
1 parent080eabe commit8883bae

File tree

6 files changed

+1
-83
lines changed

6 files changed

+1
-83
lines changed

‎config/c-library.m4

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -79,30 +79,6 @@ AH_VERBATIM(GETTIMEOFDAY_1ARG_,
7979
])# PGAC_FUNC_GETTIMEOFDAY_1ARG
8080

8181

82-
# PGAC_FUNC_GETPWUID_R_5ARG
83-
# ---------------------------
84-
# Check if getpwuid_r() takes a fifth argument (later POSIX standard, not draft version)
85-
# If so, define GETPWUID_R_5ARG
86-
AC_DEFUN([PGAC_FUNC_GETPWUID_R_5ARG],
87-
[AC_CACHE_CHECK(whethergetpwuid_rtakesafifthargument,
88-
pgac_cv_func_getpwuid_r_5arg,
89-
[AC_TRY_COMPILE([#include <sys/types.h>
90-
#include <pwd.h>],
91-
[uid_t uid;
92-
struct passwd *space;
93-
char *buf;
94-
size_t bufsize;
95-
struct passwd **result;
96-
getpwuid_r(uid, space, buf, bufsize, result);],
97-
[pgac_cv_func_getpwuid_r_5arg=yes],
98-
[pgac_cv_func_getpwuid_r_5arg=no])])
99-
if test x"$pgac_cv_func_getpwuid_r_5arg" = xyes ; then
100-
AC_DEFINE(GETPWUID_R_5ARG,1,
101-
[Define to 1 if getpwuid_r() takes a 5th argument.])
102-
fi
103-
])# PGAC_FUNC_GETPWUID_R_5ARG
104-
105-
10682
# PGAC_FUNC_STRERROR_R_INT
10783
# ---------------------------
10884
# Check if strerror_r() returns an int (SUSv3) rather than a char * (GNU libc)

‎configure

Lines changed: 0 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -12632,43 +12632,6 @@ done
1263212632

1263312633

1263412634
# Do test here with the proper thread flags
12635-
{$as_echo"$as_me:${as_lineno-$LINENO}: checking whether getpwuid_r takes a fifth argument">&5
12636-
$as_echo_n"checking whether getpwuid_r takes a fifth argument...">&6; }
12637-
if${pgac_cv_func_getpwuid_r_5arg+:}false;then:
12638-
$as_echo_n"(cached)">&6
12639-
else
12640-
cat confdefs.h -<<_ACEOF >conftest.$ac_ext
12641-
/* end confdefs.h. */
12642-
#include <sys/types.h>
12643-
#include <pwd.h>
12644-
int
12645-
main ()
12646-
{
12647-
uid_t uid;
12648-
struct passwd *space;
12649-
char *buf;
12650-
size_t bufsize;
12651-
struct passwd **result;
12652-
getpwuid_r(uid, space, buf, bufsize, result);
12653-
;
12654-
return 0;
12655-
}
12656-
_ACEOF
12657-
if ac_fn_c_try_compile"$LINENO";then:
12658-
pgac_cv_func_getpwuid_r_5arg=yes
12659-
else
12660-
pgac_cv_func_getpwuid_r_5arg=no
12661-
fi
12662-
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
12663-
fi
12664-
{$as_echo"$as_me:${as_lineno-$LINENO}: result:$pgac_cv_func_getpwuid_r_5arg">&5
12665-
$as_echo"$pgac_cv_func_getpwuid_r_5arg">&6; }
12666-
iftest x"$pgac_cv_func_getpwuid_r_5arg" = xyes;then
12667-
12668-
$as_echo"#define GETPWUID_R_5ARG 1">>confdefs.h
12669-
12670-
fi
12671-
1267212635
{$as_echo"$as_me:${as_lineno-$LINENO}: checking whether strerror_r returns int">&5
1267312636
$as_echo_n"checking whether strerror_r returns int...">&6; }
1267412637
if${pgac_cv_func_strerror_r_int+:}false;then:

‎configure.in

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1527,7 +1527,6 @@ fi
15271527
AC_CHECK_FUNCS([strerror_r getpwuid_r gethostbyname_r])
15281528

15291529
# Do test here with the proper thread flags
1530-
PGAC_FUNC_GETPWUID_R_5ARG
15311530
PGAC_FUNC_STRERROR_R_INT
15321531

15331532
CFLAGS="$_CFLAGS"

‎src/include/pg_config.h.in

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -74,9 +74,6 @@
7474
reference if 'false' */
7575
#undef FLOAT8PASSBYVAL
7676

77-
/* Define to 1 if getpwuid_r() takes a 5th argument. */
78-
#undef GETPWUID_R_5ARG
79-
8077
/* Define to 1 if gettimeofday() takes only 1 argument. */
8178
#undef GETTIMEOFDAY_1ARG
8279

‎src/include/pg_config.h.win32

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -62,9 +62,6 @@
6262
(--enable-thread-safety) */
6363
#define ENABLE_THREAD_SAFETY 1
6464

65-
/* Define to 1 if getpwuid_r() takes a 5th argument. */
66-
/* #undef GETPWUID_R_5ARG */
67-
6865
/* Define to 1 if gettimeofday() takes only 1 argument. */
6966
/* #undef GETTIMEOFDAY_1ARG */
7067

‎src/port/thread.c

Lines changed: 1 addition & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ pqStrerror(int errnum, char *strerrbuf, size_t buflen)
8282

8383
/*
8484
* Wrapper around getpwuid() or getpwuid_r() to mimic POSIX getpwuid_r()
85-
* behaviour, ifit is not available or required.
85+
* behaviour, ifthat function is not available or required.
8686
*
8787
* Per POSIX, the possible cases are:
8888
* success: returns zero, *result is non-NULL
@@ -96,21 +96,7 @@ pqGetpwuid(uid_t uid, struct passwd * resultbuf, char *buffer,
9696
size_tbuflen,structpasswd**result)
9797
{
9898
#if defined(FRONTEND)&& defined(ENABLE_THREAD_SAFETY)&& defined(HAVE_GETPWUID_R)
99-
100-
#ifdefGETPWUID_R_5ARG
101-
/* POSIX version */
10299
returngetpwuid_r(uid,resultbuf,buffer,buflen,result);
103-
#else
104-
105-
/*
106-
* Early POSIX draft of getpwuid_r() returns 'struct passwd *'.
107-
* getpwuid_r(uid, resultbuf, buffer, buflen)
108-
*/
109-
errno=0;
110-
*result=getpwuid_r(uid,resultbuf,buffer,buflen);
111-
/* paranoia: ensure we return zero on success */
112-
return (*result==NULL) ?errno :0;
113-
#endif
114100
#else
115101
/* no getpwuid_r() available, just use getpwuid() */
116102
errno=0;

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp