git-merge-changelog: Simplify installation instructions.
[gnulib.git] / m4 / passfd.m4
blob67e9c2fed049047d502f826092ed7a40a3b4cdcb
1 # passfd.m4
2 # serial 9
3 dnl Copyright (C) 2011-2024 Free Software Foundation, Inc.
4 dnl This file is free software; the Free Software Foundation
5 dnl gives unlimited permission to copy and/or distribute it,
6 dnl with or without modifications, as long as this notice is preserved.
8 AC_DEFUN([gl_PASSFD],
10   AC_REQUIRE([gl_SYS_SOCKET_H])
11   AC_CHECK_FUNCS_ONCE([recvmsg sendmsg])
13   dnl Persuade AIX 5.2 <sys/socket.h> to declare CMSG_SPACE, CMSG_LEN.
14   dnl CMSG_FIRSTHDR is POSIX 2008, but CMSG_SPACE is only in RFC 3542.
15   AC_DEFINE([_LINUX_SOURCE_COMPAT], [1],
16     [Define in order to get some macros on AIX systems.])
18   dnl Passfd prefers the POSIX use of msg.msg_control if the CMSG_* macros
19   dnl are present, but can fall back to BSD 4.3 style of msg.msg_accrights.
20   AC_CHECK_MEMBERS([struct msghdr.msg_accrights], [], [], [[
21     #include <sys/types.h>
22     #include <sys/socket.h>
23   ]])