Skip to content

Commit

Permalink
Check if getpeereid is actually declared.
Browse files Browse the repository at this point in the history
Check in sys/socket.h (AIX) and unistd.h (FreeBSD, DragonFLy and OS X).
Prevents undeclared function warning on at least some versions of AIX.
  • Loading branch information
daztucker committed Feb 17, 2020
1 parent 8aa3455 commit d4860ec
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -1986,10 +1986,11 @@ AC_CHECK_DECL([tcsendbreak],

AC_CHECK_DECLS([h_errno], , ,[#include <netdb.h>])

AC_CHECK_DECLS([SHUT_RD], , ,
AC_CHECK_DECLS([SHUT_RD, getpeereid], , ,
[
#include <sys/types.h>
#include <sys/socket.h>
#include <unistd.h>
])

AC_CHECK_DECLS([O_NONBLOCK], , ,
Expand Down
2 changes: 1 addition & 1 deletion openbsd-compat/openbsd-compat.h
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ int writev(int, struct iovec *, int);
#include "bsd-waitpid.h"
#include "bsd-poll.h"

#ifndef HAVE_GETPEEREID
#if defined(HAVE_DECL_GETPEEREID) && HAVE_DECL_GETPEEREID == 0
int getpeereid(int , uid_t *, gid_t *);
#endif

Expand Down

0 comments on commit d4860ec

Please sign in to comment.