* msghdr.h: New file.
* Makefile.am (strace_SOURCES): Add it.
* net.c: Include it. Move fallback definition of struct mmsghdr there.
* tests/mmsg.c: Include "msghdr.h". Remove fallback definition
of struct mmsghdr.
mount.c \
mpers_type.h \
mq.c \
+ msghdr.h \
mtd.c \
native_defs.h \
net.c \
--- /dev/null
+#ifndef MSGHDR_H_
+# define MSGHDR_H_
+
+/* For definitions of struct msghdr and struct mmsghdr. */
+# include <sys/socket.h>
+
+# ifndef HAVE_STRUCT_MMSGHDR
+struct mmsghdr {
+ struct msghdr msg_hdr;
+ unsigned msg_len;
+};
+# endif
+
+#endif /* MSGHDR_H_ */
*/
#include "defs.h"
+#include "msghdr.h"
#include <sys/stat.h>
#include <sys/socket.h>
#include <sys/uio.h>
uint32_t /* unsigned */ msg_len;
};
-#ifndef HAVE_STRUCT_MMSGHDR
-struct mmsghdr {
- struct msghdr msg_hdr;
- unsigned msg_len;
-};
-#endif
-
#if SUPPORTED_PERSONALITIES > 1 && SIZEOF_LONG > 4
static void
copy_from_msghdr32(struct msghdr *to_msg, struct msghdr32 *from_msg32)
# include <errno.h>
# include <stdio.h>
# include <unistd.h>
-# include <sys/socket.h>
-
-# ifndef HAVE_STRUCT_MMSGHDR
-struct mmsghdr {
- struct msghdr msg_hdr;
- unsigned msg_len;
-};
-# endif
+
+# include "msghdr.h"
static int
send_mmsg(int fd, struct mmsghdr *vec, unsigned int vlen, unsigned int flags)