Blame m4/passfd.m4

Packit 8f70b4
# passfd.m4 serial 8
Packit 8f70b4
dnl Copyright (C) 2011-2018 Free Software Foundation, Inc.
Packit 8f70b4
dnl This file is free software; the Free Software Foundation
Packit 8f70b4
dnl gives unlimited permission to copy and/or distribute it,
Packit 8f70b4
dnl with or without modifications, as long as this notice is preserved.
Packit 8f70b4
Packit 8f70b4
AC_DEFUN([gl_PASSFD],
Packit 8f70b4
[
Packit 8f70b4
  AC_REQUIRE([gl_HEADER_SYS_SOCKET])
Packit 8f70b4
  AC_CHECK_FUNCS_ONCE([recvmsg sendmsg])
Packit 8f70b4
Packit 8f70b4
  dnl Persuade AIX 5.2 <sys/socket.h> to declare CMSG_SPACE, CMSG_LEN.
Packit 8f70b4
  dnl CMSG_FIRSTHDR is POSIX 2008, but CMSG_SPACE is only in RFC 3542.
Packit 8f70b4
  AC_DEFINE([_LINUX_SOURCE_COMPAT], [1],
Packit 8f70b4
    [Define in order to get some macros on AIX systems.])
Packit 8f70b4
Packit 8f70b4
  dnl Passfd prefers the POSIX use of msg.msg_control if the CMSG_* macros
Packit 8f70b4
  dnl are present, but can fall back to BSD 4.3 style of msg.msg_accrights.
Packit 8f70b4
  AC_CHECK_MEMBERS([struct msghdr.msg_accrights], [], [], [[
Packit 8f70b4
    #include <sys/types.h>
Packit 8f70b4
    #include <sys/socket.h>
Packit 8f70b4
  ]])
Packit 8f70b4
])