mirror of
https://github.com/FRRouting/frr.git
synced 2025-04-30 13:37:17 +02:00
build: check for sendmmsg() and struct mmsghdr
These will be used by the RFC5424 log target. Signed-off-by: David Lamparter <equinox@diac24.net>
This commit is contained in:
parent
939e32702a
commit
d948c317c5
|
@ -1299,8 +1299,11 @@ AC_CHECK_FUNCS([ \
|
|||
openat \
|
||||
unlinkat \
|
||||
posix_fallocate \
|
||||
sendmmsg \
|
||||
])
|
||||
|
||||
AC_CHECK_MEMBERS([struct mmsghdr.msg_hdr], [], [], FRR_INCLUDES)
|
||||
|
||||
dnl ##########################################################################
|
||||
dnl LARGE if block spans a lot of "configure"!
|
||||
if test "$enable_clippy_only" != "yes"; then
|
||||
|
|
20
lib/zebra.h
20
lib/zebra.h
|
@ -230,6 +230,26 @@ size_t strlcpy(char *__restrict dest,
|
|||
const char *__restrict src, size_t destsize);
|
||||
#endif
|
||||
|
||||
#if !defined(HAVE_STRUCT_MMSGHDR_MSG_HDR) || !defined(HAVE_SENDMMSG)
|
||||
/* avoid conflicts in case we have partial support */
|
||||
#define mmsghdr frr_mmsghdr
|
||||
#define sendmmsg frr_sendmmsg
|
||||
|
||||
struct mmsghdr {
|
||||
struct msghdr msg_hdr;
|
||||
unsigned int msg_len;
|
||||
};
|
||||
|
||||
/* just go 1 at a time here, the loop this is used in will handle the rest */
|
||||
static inline int sendmmsg(int fd, struct mmsghdr *mmh, unsigned int len,
|
||||
int flags)
|
||||
{
|
||||
int rv = sendmsg(fd, &mmh->msg_hdr, 0);
|
||||
|
||||
return rv > 0 ? 1 : rv;
|
||||
}
|
||||
#endif
|
||||
|
||||
/*
|
||||
* RFC 3542 defines several macros for using struct cmsghdr.
|
||||
* Here, we define those that are not present
|
||||
|
|
Loading…
Reference in a new issue