1 // SPDX-License-Identifier: GPL-2.0
7 #define O_DIRECT 00040000
11 #define O_DIRECTORY 00200000
15 #define O_NOATIME 01000000
19 #define O_TMPFILE 020000000
23 #define O_LARGEFILE 00100000
25 size_t open__scnprintf_flags(unsigned long flags
, char *bf
, size_t size
)
30 return scnprintf(bf
, size
, "RDONLY");
32 if (flags & O_##n) { \
33 printed += scnprintf(bf + printed, size - printed, "%s%s", printed ? "|" : "", #n); \
59 if ((flags
& O_SYNC
) == O_SYNC
)
60 printed
+= scnprintf(bf
+ printed
, size
- printed
, "%s%s", printed
? "|" : "", "SYNC");
72 printed
+= scnprintf(bf
+ printed
, size
- printed
, "%s%#x", printed
? "|" : "", flags
);
77 size_t syscall_arg__scnprintf_open_flags(char *bf
, size_t size
, struct syscall_arg
*arg
)
81 if (!(flags
& O_CREAT
))
82 arg
->mask
|= 1 << (arg
->idx
+ 1); /* Mask the mode parm */
84 return open__scnprintf_flags(flags
, bf
, size
);