SAT>IP define the recvmmsg syscall for some libc implementations

This commit is contained in:
Jaroslav Kysela 2014-04-16 11:37:18 +02:00
parent eb7b4057f5
commit 28bd7e10e7
2 changed files with 42 additions and 0 deletions

12
configure vendored
View file

@ -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
#

View file

@ -26,6 +26,36 @@
#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 );