1 // SPDX-License-Identifier: LGPL-2.1
6 /* From include/linux/stat.h */
8 #define S_IRWXUGO (S_IRWXU|S_IRWXG|S_IRWXO)
11 #define S_IALLUGO (S_ISUID|S_ISGID|S_ISVTX|S_IRWXUGO)
14 #define S_IRUGO (S_IRUSR|S_IRGRP|S_IROTH)
17 #define S_IWUGO (S_IWUSR|S_IWGRP|S_IWOTH)
20 #define S_IXUGO (S_IXUSR|S_IXGRP|S_IXOTH)
23 static size_t syscall_arg__scnprintf_mode_t(char *bf
, size_t size
, struct syscall_arg
*arg
)
25 bool show_prefix
= arg
->show_string_prefix
;
26 const char *prefix
= "S_";
27 int printed
= 0, mode
= arg
->val
;
30 if ((mode & S_##n) == S_##n) { \
31 printed += scnprintf(bf + printed, size - printed, "%s%s%s", printed ? "|" : "", show_prefix ? prefix : "", #n); \
66 printed
+= scnprintf(bf
+ printed
, size
- printed
, "%s%#x", printed
? "|" : "", mode
);
71 #define SCA_MODE_T syscall_arg__scnprintf_mode_t