diff --git a/io.c b/io.c index 7500994..35a3110 100644 --- a/io.c +++ b/io.c @@ -743,16 +743,18 @@ int st_sendmsg(_st_netfd_t *fd, const struct msghdr *msg, int flags, st_utime_t } -#if defined(MD_HAVE_SENDMMSG) && defined(_GNU_SOURCE) -int st_sendmmsg(st_netfd_t fd, struct mmsghdr *msgvec, unsigned int vlen, int flags, st_utime_t timeout) +int st_sendmmsg(st_netfd_t fd, void *msgvec, unsigned int vlen, int flags, st_utime_t timeout) { +#if !defined(MD_HAVE_SENDMMSG) || !defined(_GNU_SOURCE) + return -1; +#else int n; int left; struct mmsghdr *p; left = (int)vlen; while (left > 0) { - p = msgvec + (vlen - left); + p = (struct mmsghdr*)msgvec + (vlen - left); if ((n = sendmmsg(fd->osfd, p, left, flags)) < 0) { if (errno == EINTR) @@ -772,8 +774,8 @@ int st_sendmmsg(st_netfd_t fd, struct mmsghdr *msgvec, unsigned int vlen, int fl return n; } return (int)vlen - left; -} #endif +} /* diff --git a/public.h b/public.h index c54bd79..a581adc 100644 --- a/public.h +++ b/public.h @@ -151,7 +151,7 @@ extern int st_recvfrom(st_netfd_t fd, void *buf, int len, struct sockaddr *from, extern int st_sendto(st_netfd_t fd, const void *msg, int len, const struct sockaddr *to, int tolen, st_utime_t timeout); extern int st_recvmsg(st_netfd_t fd, struct msghdr *msg, int flags, st_utime_t timeout); extern int st_sendmsg(st_netfd_t fd, const struct msghdr *msg, int flags, st_utime_t timeout); -extern int st_sendmmsg(st_netfd_t fd, struct mmsghdr *msgvec, unsigned int vlen, int flags, st_utime_t timeout); +extern int st_sendmmsg(st_netfd_t fd, void *msgvec, unsigned int vlen, int flags, st_utime_t timeout); extern st_netfd_t st_open(const char *path, int oflags, mode_t mode); #ifdef DEBUG