+2021-12-24 Bruno Haible <bruno@clisp.org>
+
+ passfd: Fix compilation error on IRIX.
+ * lib/passfd.c (sendfd): On IRIX, ignore CMSG_FIRSTHDR.
+ (recvfd): Likewise. Produce a fake error ENOTCONN.
+
2021-12-24 Bruno Haible <bruno@clisp.org>
tests: Fix link errors on AIX.
char byte = 0;
struct iovec iov;
struct msghdr msg;
-# ifdef CMSG_FIRSTHDR
+# if defined CMSG_FIRSTHDR && !defined __sgi
struct cmsghdr *cmsg;
char buf[CMSG_SPACE (sizeof fd)];
# endif
msg.msg_name = NULL;
msg.msg_namelen = 0;
-# ifdef CMSG_FIRSTHDR
+# if defined CMSG_FIRSTHDR && !defined __sgi
msg.msg_control = buf;
msg.msg_controllen = sizeof buf;
cmsg = CMSG_FIRSTHDR (&msg);
struct msghdr msg;
int fd = -1;
ssize_t len;
-# ifdef CMSG_FIRSTHDR
+# if defined CMSG_FIRSTHDR && !defined __sgi
struct cmsghdr *cmsg;
char buf[CMSG_SPACE (sizeof fd)];
int flags_recvmsg = flags & O_CLOEXEC ? MSG_CMSG_CLOEXEC : 0;
msg.msg_name = NULL;
msg.msg_namelen = 0;
-# ifdef CMSG_FIRSTHDR
+# if defined CMSG_FIRSTHDR && !defined __sgi
msg.msg_control = buf;
msg.msg_controllen = sizeof buf;
cmsg = CMSG_FIRSTHDR (&msg);
return -1;
}
}
+
+ if (fd < 0 && errno == 0)
+ errno = ENOTCONN;
# else
errno = ENOSYS;
# endif