1 // SPDX-License-Identifier: LGPL-2.1
3 #include <sys/socket.h>
9 #define MSG_WAITFORONE 0x10000
12 #define MSG_BATCH 0x40000
14 #ifndef MSG_SOCK_DEVMEM
15 #define MSG_SOCK_DEVMEM 0x2000000
18 #define MSG_ZEROCOPY 0x4000000
20 #ifndef MSG_SPLICE_PAGES
21 #define MSG_SPLICE_PAGES 0x8000000
24 #define MSG_FASTOPEN 0x20000000
26 #ifndef MSG_CMSG_CLOEXEC
27 # define MSG_CMSG_CLOEXEC 0x40000000
30 static size_t syscall_arg__scnprintf_msg_flags(char *bf
, size_t size
,
31 struct syscall_arg
*arg
)
33 bool show_prefix
= arg
->show_string_prefix
;
34 const char *prefix
= "MSG_";
35 int printed
= 0, flags
= arg
->val
;
38 return scnprintf(bf
, size
, "NONE");
39 #define P_MSG_FLAG(n) \
40 if (flags & MSG_##n) { \
41 printed += scnprintf(bf + printed, size - printed, "%s%s%s", printed ? "|" : "", show_prefix ? prefix : "", #n); \
47 P_MSG_FLAG(DONTROUTE
);
61 P_MSG_FLAG(WAITFORONE
);
63 P_MSG_FLAG(SOCK_DEVMEM
);
65 P_MSG_FLAG(SPLICE_PAGES
);
67 P_MSG_FLAG(CMSG_CLOEXEC
);
71 printed
+= scnprintf(bf
+ printed
, size
- printed
, "%s%#x", printed
? "|" : "", flags
);
76 #define SCA_MSG_FLAGS syscall_arg__scnprintf_msg_flags