1 // SPDX-License-Identifier: GPL-2.0
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 int printed
= 0, mode
= arg
->val
;
28 if ((mode & S_##n) == S_##n) { \
29 printed += scnprintf(bf + printed, size - printed, "%s%s", printed ? "|" : "", #n); \
64 printed
+= scnprintf(bf
+ printed
, size
- printed
, "%s%#x", printed
? "|" : "", mode
);
69 #define SCA_MODE_T syscall_arg__scnprintf_mode_t