#include <assert.h>
#include <stdlib.h>
-#include <sys/poll.h>
+#include <poll.h>
// At one point, poll()'s checking was not done accurately. This test
// exposes this -- previously Memcheck only found one error, now if finds
#if defined(HAVE_SYS_EVENTFD_H)
#include <sys/eventfd.h>
#endif
-#if defined(HAVE_SYS_POLL_H)
-#include <sys/poll.h>
-#endif
+#include <poll.h>
#if defined(HAVE_SYS_SIGNALFD_H)
#include <sys/signalfd.h>
#endif
struct cmsghdr cm;
char control[CMSG_SPACE(sizeof(int) * 2)];
} control_un;
- struct msghdr msg = { NULL, 0, iov, 1, control_un.control,
- sizeof(control_un), 0 };
+ struct msghdr msg;
+ /* this was using brace initialization
+ * but that doesn't work on MSL because of padding fields
+ * C99 designated initializers would be nicer
+ * but I'll just do it the simple way */
+ msg.msg_name = NULL;
+ msg.msg_namelen = 0;
+ msg.msg_iov = iov;
+ msg.msg_iovlen = 1;
+ msg.msg_control = control_un.control;
+ msg.msg_controllen = sizeof(control_un);
+ msg.msg_flags = 0;
struct cmsghdr *cmsg = &control_un.cm;
char buf[1024];