1 // SPDX-License-Identifier: GPL-2.0
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 int printed
= 0, flags
= arg
->val
;
27 return scnprintf(bf
, size
, "NONE");
28 #define P_MSG_FLAG(n) \
29 if (flags & MSG_##n) { \
30 printed += scnprintf(bf + printed, size - printed, "%s%s", printed ? "|" : "", #n); \
36 P_MSG_FLAG(DONTROUTE
);
50 P_MSG_FLAG(WAITFORONE
);
51 P_MSG_FLAG(SENDPAGE_NOTLAST
);
53 P_MSG_FLAG(CMSG_CLOEXEC
);
57 printed
+= scnprintf(bf
+ printed
, size
- printed
, "%s%#x", printed
? "|" : "", flags
);
62 #define SCA_MSG_FLAGS syscall_arg__scnprintf_msg_flags