passfd: allow compilation on mingw
authorEric Blake <eblake@redhat.com>
Thu, 21 Apr 2011 13:16:20 +0000 (07:16 -0600)
committerEric Blake <eblake@redhat.com>
Thu, 21 Apr 2011 20:35:06 +0000 (14:35 -0600)
commit06d76f63c628cb1653f3c27a1f60a46cf44665ba
treed1a58524825f832abe9a8ea5326a2aa70f666e13
parent753425d56eedab92c361cae9d6baa701d893fbc9
passfd: allow compilation on mingw

The passfd module now skips on mingw, rather than failing to compile.

It may be nice to add a sendmsg and recvmsg module in the future,
but for now passfd is the only client that cares.

* modules/sys_socket (Depends-on): Add sys_uio.
* lib/sys_socket.in.h [!@HAVE_SYS_SOCKET_H@]: Use it for struct
iovec and a minimal struct msghdr.
* tests/test-sys_socket.c (main): Enhance test.
* m4/afunix.m4 (gl_SOCKET_AFUNIX): Detect recvmsg/sendmsg.
* lib/passfd.c (include): Drop <sys/uio.h>; <sys/sockets.h> is
guaranteed to provide what we need.
(sendmsg, recvmsg): Declare fallbacks if we lack sendmsg.
* modules/passfd-tests (Depends-on): Add sys_wait.
* tests/test-passfd.c (main): Skip test on mingw, for now.
* doc/posix-headers/sys_socket.texi (sys/socket.h): Document the
partial 'struct msghdr' implementation.

Signed-off-by: Eric Blake <eblake@redhat.com>
ChangeLog
doc/posix-headers/sys_socket.texi
lib/passfd.c
lib/sys_socket.in.h
m4/afunix.m4
modules/passfd-tests
modules/sys_socket
tests/test-passfd.c
tests/test-sys_socket.c