1 // SPDX-License-Identifier: LGPL-2.1
3 #include <sys/socket.h>
9 #define MSG_WAITFORONE 0x10000
11 #ifndef MSG_SENDPAGE_NOTLAST
12 #define MSG_SENDPAGE_NOTLAST 0x20000
15 #define MSG_FASTOPEN 0x20000000
17 #ifndef MSG_CMSG_CLOEXEC
18 # define MSG_CMSG_CLOEXEC 0x40000000
21 static size_t syscall_arg__scnprintf_msg_flags(char *bf, size_t size,
22 struct syscall_arg *arg)
24 bool show_prefix = arg->show_string_prefix;
25 const char *prefix = "MSG_";
26 int printed = 0, flags = arg->val;
29 return scnprintf(bf, size, "NONE");
30 #define P_MSG_FLAG(n) \
31 if (flags & MSG_##n) { \
32 printed += scnprintf(bf + printed, size - printed, "%s%s%s", printed ? "|" : "", show_prefix ? prefix : "", #n); \
38 P_MSG_FLAG(DONTROUTE);
52 P_MSG_FLAG(WAITFORONE);
53 P_MSG_FLAG(SENDPAGE_NOTLAST);
55 P_MSG_FLAG(CMSG_CLOEXEC);
59 printed += scnprintf(bf + printed, size - printed, "%s%#x", printed ? "|" : "", flags);
64 #define SCA_MSG_FLAGS syscall_arg__scnprintf_msg_flags