2005-05-31 Dmitry V. Levin <ldv@altlinux.org>
* util.c (printxval): Change third argument from "char *" to
"const char *".
(printflags): Add third argument, "const char *", with similar
meaning to the third argument of printxval().
* defs.h (printxval): Change third argument from "char *" to
"const char *".
(printflags): Add third argument.
* bjm.c (sys_query_module) [LINUX]: Pass third argument to
printflags().
* desc.c (sys_fcntl): Likewise.
(sys_flock) [LOCK_SH]: Likewise.
(print_epoll_event) [HAVE_SYS_EPOLL_H]: Likewise.
* file.c (sys_open): Likewise.
(solaris_open) [LINUXSPARC]: Likewise.
(sys_access): Likewise.
(sys_chflags, sys_fchflags) [FREEBSD]: Likewise.
(realprintstat) [HAVE_LONG_LONG_OFF_T &&
HAVE_STRUCT_STAT_ST_FLAGS]: Likewise.
(printstat64) [HAVE_STAT64 &&
HAVE_STRUCT_STAT_ST_FLAGS]: Likewise.
(sys_setxattr, sys_fsetxattr): Likewise.
* ipc.c (sys_msgget, sys_msgsnd, sys_msgrcv, sys_semget,
sys_shmget, sys_shmat) [LINUX || SUNOS4 || FREEBSD]: Likewise.
(sys_mq_open) [LINUX]: Likewise.
(printmqattr) [HAVE_MQUEUE_H]: Likewise.
* mem.c (print_mmap) [!HAVE_LONG_LONG_OFF_T]: Likewise.
(sys_mmap64) [_LFS64_LARGEFILE || HAVE_LONG_LONG_OFF_T]: Likewise.
(sys_mprotect): Likewise.
(sys_mremap, sys_madvise, sys_mlockall) [LINUX]: Likewise.
(sys_msync) [MS_ASYNC]: Likewise.
(sys_mctl) [MC_SYNC]: Likewise.
(sys_remap_file_pages, sys_mbind, sys_get_mempolicy) [LINUX]:
Likewise.
* net.c (printmsghdr) [HAVE_STRUCT_MSGHDR_MSG_CONTROL]: Likewise.
(sys_send, sys_sendto): Likewise.
(sys_sendmsg) [HAVE_SENDMSG]: Likewise.
(sys_recv, sys_recvfrom): Likewise.
(sys_recvmsg) [HAVE_SENDMSG]: Likewise.
(printicmpfilter) [ICMP_FILTER]: Likewise.
* proc.c (proc_ioctl) [SVR4 && !HAVE_MP_PROCFS || FREEBSD]: Likewise.
* process.c (sys_clone) [LINUX]: Likewise.
(printwaitn): Likewise.
(sys_waitid) [SVR4 || LINUX]: Likewise.
* signal.c (sys_sigvec) [SUNOS4 || FREEBSD]: Likewise.
(sys_sigaction): Likewise.
(printcontext) [SVR4]: Likewise.
(print_stack_t) [LINUX) || FREEBSD]: Likewise.
(sys_rt_sigaction) [LINUX]: Likewise.
* sock.c (sock_ioctl) [LINUX]: Likewise.
* stream.c (sys_putmsg, sys_getmsg): Likewise.
(sys_putpmsg) [SYS_putpmsg]: Likewise.
(sys_getpmsg) [SYS_getpmsg]: Likewise.
(sys_poll): Likewise.
(print_transport_message) [TI_BIND]: Likewise.
(stream_ioctl): Likewise.
* system.c (sys_mount, sys_reboot): Likewise.
(sys_cacheflush) [LINUX && M68K]: Likewise.
(sys_capget, sys_capset) [SYS_capget]: Likewise.
* term.c (term_ioctl) [TIOCMGET]: Likewise.
* time.c (sys_clock_nanosleep, sys_timer_settime) [LINUX]:
Likewise.
Fixes RH#159310.
diff --git a/system.c b/system.c
index 623571c..7bbcdcd 100644
--- a/system.c
+++ b/system.c
@@ -112,7 +112,7 @@
else
tprintf("%#lx", tcp->u_arg[2]);
tprintf(", ");
- printflags(mount_flags, tcp->u_arg[3]);
+ printflags(mount_flags, tcp->u_arg[3], "MS_???");
tprintf(", %#lx", tcp->u_arg[4]);
}
return 0;
@@ -197,14 +197,11 @@
struct tcb *tcp;
{
if (entering(tcp)) {
- if (!printflags(bootflags1, tcp->u_arg[0]))
- tprintf("LINUX_REBOOT_MAGIC???");
+ printflags(bootflags1, tcp->u_arg[0], "LINUX_REBOOT_MAGIC_???");
tprintf(", ");
- if (!printflags(bootflags2, tcp->u_arg[1]))
- tprintf("LINUX_REBOOT_MAGIC???");
+ printflags(bootflags2, tcp->u_arg[1], "LINUX_REBOOT_MAGIC_???");
tprintf(", ");
- if (!printflags(bootflags3, tcp->u_arg[2]))
- tprintf("LINUX_REBOOT_CMD_???");
+ printflags(bootflags3, tcp->u_arg[2], "LINUX_REBOOT_CMD_???");
if (tcp->u_arg[2] == LINUX_REBOOT_CMD_RESTART2) {
tprintf(", ");
printstr(tcp, tcp->u_arg[3], -1);
@@ -251,7 +248,7 @@
printxval(cacheflush_scope, tcp->u_arg[1], "FLUSH_SCOPE_???");
tprintf(", ");
/* flags */
- printflags(cacheflush_flags, tcp->u_arg[2]);
+ printflags(cacheflush_flags, tcp->u_arg[2], "FLUSH_CACHE_???");
/* len */
tprintf(", %lu", tcp->u_arg[3]);
}
@@ -302,8 +299,7 @@
struct tcb *tcp;
{
if (entering(tcp)) {
- if (!printflags(bootflags, tcp->u_arg[0]))
- tprintf("RB_???");
+ printflags(bootflags, tcp->u_arg[0], "RB_???");
if (tcp->u_arg[0] & RB_STRING) {
printstr(tcp, tcp->u_arg[1], -1);
}
@@ -401,8 +397,7 @@
}
printstr(tcp, tcp->u_arg[1], -1);
tprintf(", ");
- if (!printflags(mountflags, tcp->u_arg[2] & ~M_NEWTYPE))
- tprintf("0");
+ printflags(mountflags, tcp->u_arg[2] & ~M_NEWTYPE, "M_???");
tprintf(", ");
if (strcmp(type, "4.2") == 0) {
@@ -422,8 +417,7 @@
tprintf("[");
printsock(tcp, (int) a.addr);
tprintf(", ");
- if (!printflags(nfsflags, a.flags))
- tprintf("NFSMNT_???");
+ printflags(nfsflags, a.flags, "NFSMNT_???");
tprintf(", ws:%u,rs:%u,to:%u,re:%u,",
a.wsize, a.rsize, a.timeo, a.retrans);
if (a.flags & NFSMNT_HOSTNAME && a.hostname)
@@ -1216,7 +1210,7 @@
tprintf(", ");
printpath(tcp, tcp->u_arg[1]);
tprintf(", ");
- printflags(mount_flags, tcp->u_arg[2]);
+ printflags(mount_flags, tcp->u_arg[2], "MS_???");
if (tcp->u_arg[2] & (MS_FSS | MS_DATA)) {
tprintf(", ");
tprintf("%ld", tcp->u_arg[3]);
@@ -1233,8 +1227,7 @@
tprintf("addr=");
printsock(tcp, (int) args.addr);
tprintf(", flags=");
- if (!printflags(nfs_flags, args.flags))
- tprintf("NFSMNT_???");
+ printflags(nfs_flags, args.flags, "NFSMNT_???");
tprintf(", hostname=");
printstr(tcp, (int) args.hostname, -1);
tprintf(", ...}");
@@ -1329,7 +1322,7 @@
tprintf(", ");
printpath(tcp, tcp->u_arg[1]);
tprintf(", ");
- printflags(mount_flags, tcp->u_arg[2]);
+ printflags(mount_flags, tcp->u_arg[2], "MS_???");
/* The doc sez that the file system type is given as a
fsindex, and we should use sysfs to work out the name.
This appears to be untrue for UW. Maybe it's untrue
@@ -1353,8 +1346,7 @@
tprintf("%#lx", tcp->u_arg[4]);
else {
tprintf("{ flags=");
- if (!printflags(vxfs_flags, args.mflags))
- tprintf("0x%08x", args.mflags);
+ printflags(vxfs_flags, args.mflags, "VX_MS_???");
if (args.mflags & VX_MS_SNAPSHOT) {
tprintf (", snapof=");
printstr (tcp,
@@ -1387,8 +1379,7 @@
printsock(tcp, (int) addr.buf, addr.len);
}
tprintf(", flags=");
- if (!printflags(nfs_flags, args.flags))
- tprintf("NFSMNT_???");
+ printflags(nfs_flags, args.flags, "NFSMNT_???");
tprintf(", hostname=");
printstr(tcp, (int) args.hostname, -1);
tprintf(", ...}");
@@ -1497,11 +1488,11 @@
tprintf("???");
else {
tprintf("{");
- printflags(capabilities, arg1->effective);
+ printflags(capabilities, arg1->effective, "CAP_???");
tprintf(", ");
- printflags(capabilities, arg1->permitted);
+ printflags(capabilities, arg1->permitted, "CAP_???");
tprintf(", ");
- printflags(capabilities, arg1->inheritable);
+ printflags(capabilities, arg1->inheritable, "CAP_???");
tprintf("}");
}
}
@@ -1549,11 +1540,11 @@
tprintf("???");
else {
tprintf("{");
- printflags(capabilities, arg1->effective);
+ printflags(capabilities, arg1->effective, "CAP_???");
tprintf(", ");
- printflags(capabilities, arg1->permitted);
+ printflags(capabilities, arg1->permitted, "CAP_???");
tprintf(", ");
- printflags(capabilities, arg1->inheritable);
+ printflags(capabilities, arg1->inheritable, "CAP_???");
tprintf("}");
}
}