]> git.ipfire.org Git - thirdparty/tvheadend.git/commitdiff
SAT>IP define the recvmmsg syscall for some libc implementations
authorJaroslav Kysela <perex@perex.cz>
Wed, 16 Apr 2014 09:37:18 +0000 (11:37 +0200)
committerJaroslav Kysela <perex@perex.cz>
Mon, 5 May 2014 20:00:36 +0000 (22:00 +0200)
configure
src/input/mpegts/satip/satip_frontend.c

index 161c75935c607de44572c9ecaa99691d7f5296fc..8d0e47cc1cb2fc56e82d35409128bba4af9010e0 100755 (executable)
--- a/configure
+++ b/configure
@@ -113,6 +113,18 @@ int test(void)
   return 0;
 }
 '
+
+check_cc_snippet recvmmsg '
+#define _GNU_SOURCE
+#include <stdlib.h>
+#include <sys/socket.h>
+#define TEST test
+int test(void)
+{
+  recvmmsg(0, NULL, 0, 0, NULL);
+  return 0;
+}
+'
 #
 # Python
 #
index 859e556c558855f2119a04be56cea8b679cedab5..4f8ee25aa2d12eadda18b0a9f6f4519123ba3d91 100644 (file)
 #include "http.h"
 #include "satip_private.h"
 
+#ifndef CONFIG_RECVMMSG
+
+#ifdef __linux__
+
+/* define the syscall - works only for linux */
+
+#include <linux/unistd.h>
+
+struct mmsghdr {
+  struct msghdr msg_hdr;
+  unsigned int  msg_len;
+};
+
+int recvmmsg(int sockfd, struct mmsghdr *msgvec, unsigned int vlen,
+             unsigned int flags, struct timespec *timeout);
+
+int recvmmsg(int sockfd, struct mmsghdr *msgvec, unsigned int vlen,
+             unsigned int flags, struct timespec *timeout)
+{
+  return syscall(__NR_recvmmsg, sockfd, msgvec, vlen, flags, timeout);
+}
+
+#else /* not __linux__ */
+
+#error "Add recvmmsg() support for your platform!!!"
+
+#endif
+
+#endif /* ENABLE_RECVMMSG */
+
 static int
 satip_frontend_tune1
   ( satip_frontend_t *lfe, mpegts_mux_instance_t *mmi );