On Android, 32-bit arm and x86 use __kernel_mode_t (an unsigned short)
as their mode_t. The open(2) flags are actually an int, so high ones
like O_CLOEXEC get truncated if you coerce them to mode_t.
* defs.h (tprint_open_modes, sprint_open_modes): Change argument type
from mode_t to int.
* file.c (tprint_open_modes, sprint_open_modes): Likewise.
Signed-off-by: Elliott Hughes <enh@google.com>
Signed-off-by: Dmitry V. Levin <ldv@altlinux.org>
extern void printsignal(int);
extern void tprint_iov(struct tcb *, unsigned long, unsigned long, int decode_iov);
extern void tprint_iov_upto(struct tcb *, unsigned long, unsigned long, int decode_iov, unsigned long);
-extern void tprint_open_modes(mode_t);
-extern const char *sprint_open_modes(mode_t);
+extern void tprint_open_modes(int);
+extern const char *sprint_open_modes(int);
extern void print_loff_t(struct tcb *, long);
extern const struct_ioctlent *ioctl_lookup(unsigned long);
* other bits are real flags.
*/
const char *
-sprint_open_modes(mode_t flags)
+sprint_open_modes(int flags)
{
static char outstr[(1 + ARRAY_SIZE(open_mode_flags)) * sizeof("O_LARGEFILE")];
char *p;
}
void
-tprint_open_modes(mode_t flags)
+tprint_open_modes(int flags)
{
tprints(sprint_open_modes(flags) + sizeof("flags"));
}