aboutsummaryrefslogtreecommitdiffstats
path: root/src/vcl/ldp_glibc_socket.h
diff options
context:
space:
mode:
authorFlorin Coras <fcoras@cisco.com>2023-02-02 12:56:16 -0800
committerDave Barach <vpp@barachs.net>2023-02-07 18:06:44 +0000
commit3684794336602435b91b91a1dc5bd9401a974432 (patch)
tree9475f51d264a35774422009f7a720d6073676e97 /src/vcl/ldp_glibc_socket.h
parent656a550f1feda3ddfa96f8e1fc510e8eebd3ce7a (diff)
vcl: better handlig of ldp apis that rely on gnu source
Control use of apis that rely on _GNU_SOURCE being defined with compile time macro. Also fixes sendmmsg and recvmmsg which were not probably wrapped. Type: improvement Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: I207de23210d4b9dc960bb4289159502760c5614d
Diffstat (limited to 'src/vcl/ldp_glibc_socket.h')
-rw-r--r--src/vcl/ldp_glibc_socket.h11
1 files changed, 5 insertions, 6 deletions
diff --git a/src/vcl/ldp_glibc_socket.h b/src/vcl/ldp_glibc_socket.h
index 95fb7c81094..dcd37208ff6 100644
--- a/src/vcl/ldp_glibc_socket.h
+++ b/src/vcl/ldp_glibc_socket.h
@@ -200,15 +200,14 @@ recvfrom (int __fd, void *__restrict __buf,
extern ssize_t
sendmsg (int __fd, const struct msghdr *__message, int __flags);
-#ifdef __USE_GNU
+#ifdef _GNU_SOURCE
/* Send a VLEN messages as described by VMESSAGES to socket FD.
Returns the number of datagrams successfully written or -1 for errors.
This function is a cancellation point and therefore not marked with
__THROW. */
-extern int
-sendmmsg (int __fd, struct mmsghdr *__vmessages,
- unsigned int __vlen, int __flags);
+extern int sendmmsg (int __fd, struct mmsghdr *__vmessages,
+ unsigned int __vlen, int __flags);
#endif
/* Receive a message as described by MESSAGE from socket FD.
@@ -218,7 +217,7 @@ sendmmsg (int __fd, struct mmsghdr *__vmessages,
__THROW. */
extern ssize_t recvmsg (int __fd, struct msghdr *__message, int __flags);
-#ifdef __USE_GNU
+#ifdef _GNU_SOURCE
/* Receive up to VLEN messages as described by VMESSAGES from socket FD.
Returns the number of messages received or -1 for errors.
@@ -337,7 +336,7 @@ epoll_pwait (int __epfd, struct epoll_event *__events,
__THROW. */
extern int poll (struct pollfd *__fds, nfds_t __nfds, int __timeout);
-#ifdef __USE_GNU
+#ifdef _GNU_SOURCE
/* Like poll, but before waiting the threads signal mask is replaced
with that specified in the fourth parameter. For better usability,
the timeout value is specified using a TIMESPEC object.