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/mem.c b/mem.c
index fbc26da..08a5f92 100644
--- a/mem.c
+++ b/mem.c
@@ -199,14 +199,14 @@
 		/* len */
 		tprintf("%lu, ", u_arg[1]);
 		/* prot */
-		printflags(mmap_prot, u_arg[2]);
+		printflags(mmap_prot, u_arg[2], "PROT_???");
 		tprintf(", ");
 		/* flags */
 #ifdef MAP_TYPE
 		printxval(mmap_flags, u_arg[3] & MAP_TYPE, "MAP_???");
 		addflags(mmap_flags, u_arg[3] & ~MAP_TYPE);
 #else
-		printflags(mmap_flags, u_arg[3]);
+		printflags(mmap_flags, u_arg[3], "MAP_???");
 #endif
 		/* fd (is always int, not long) */
 		tprintf(", %d, ", (int)u_arg[4]);
@@ -300,14 +300,14 @@
 		/* len */
 		tprintf("%lu, ", u_arg[1]);
 		/* prot */
-		printflags(mmap_prot, u_arg[2]);
+		printflags(mmap_prot, u_arg[2], "PROT_???");
 		tprintf(", ");
 		/* flags */
 #ifdef MAP_TYPE
 		printxval(mmap_flags, u_arg[3] & MAP_TYPE, "MAP_???");
 		addflags(mmap_flags, u_arg[3] & ~MAP_TYPE);
 #else
-		printflags(mmap_flags, u_arg[3]);
+		printflags(mmap_flags, u_arg[3], "MAP_???");
 #endif
 		/* fd */
 		tprintf(", %ld, ", u_arg[4]);
@@ -337,8 +337,7 @@
 	if (entering(tcp)) {
 		tprintf("%#lx, %lu, ",
 			tcp->u_arg[0], tcp->u_arg[1]);
-		if (!printflags(mmap_prot, tcp->u_arg[2]))
-			tprintf("PROT_???");
+		printflags(mmap_prot, tcp->u_arg[2], "PROT_???");
 	}
 	return 0;
 }
@@ -357,7 +356,7 @@
 	if (entering(tcp)) {
 		tprintf("%#lx, %lu, %lu, ", tcp->u_arg[0], tcp->u_arg[1],
 			tcp->u_arg[2]);
-		printflags(mremap_flags, tcp->u_arg[3]);
+		printflags(mremap_flags, tcp->u_arg[3], "MREMAP_???");
 	}
 	return RVAL_HEX;
 }
@@ -388,7 +387,7 @@
 {
 	if (entering(tcp)) {
 		tprintf("%#lx, %lu, ", tcp->u_arg[0], tcp->u_arg[1]);
-		printflags(madvise_flags, tcp->u_arg[2]);
+		printflags(madvise_flags, tcp->u_arg[2], "MADV_???");
 	}
 	return 0;
 }
@@ -409,7 +408,7 @@
 struct tcb *tcp;
 {
 	if (entering(tcp)) {
-		printflags(mlockall_flags, tcp->u_arg[0]);
+		printflags(mlockall_flags, tcp->u_arg[0], "MCL_???");
 	}
 	return 0;
 }
@@ -438,8 +437,7 @@
 		/* len */
 		tprintf(", %lu, ", tcp->u_arg[1]);
 		/* flags */
-		if (!printflags(mctl_sync, tcp->u_arg[2]))
-			tprintf("MS_???");
+		printflags(mctl_sync, tcp->u_arg[2], "MS_???");
 	}
 	return 0;
 }
@@ -476,19 +474,16 @@
 		tprintf(", %lu, ", tcp->u_arg[1]);
 		/* function */
 		function = tcp->u_arg[2];
-		if (!printflags(mctl_funcs, function))
-			tprintf("MC_???");
+		printflags(mctl_funcs, function, "MC_???");
 		/* arg */
 		arg = tcp->u_arg[3];
 		tprintf(", ");
 		switch (function) {
 		case MC_SYNC:
-			if (!printflags(mctl_sync, arg))
-				tprintf("MS_???");
+			printflags(mctl_sync, arg, "MS_???");
 			break;
 		case MC_LOCKAS:
-			if (!printflags(mctl_lockas, arg))
-				tprintf("MCL_???");
+			printflags(mctl_lockas, arg, "MCL_???");
 			break;
 		default:
 			tprintf("%#x", arg);
@@ -646,13 +641,13 @@
 {
 	if (entering(tcp)) {
 		tprintf("%#lx, %lu, ", tcp->u_arg[0], tcp->u_arg[1]);
-		printflags(mmap_prot, tcp->u_arg[2]);
+		printflags(mmap_prot, tcp->u_arg[2], "PROT_???");
 		tprintf(", %lu, ", tcp->u_arg[3]);
 #ifdef MAP_TYPE
 		printxval(mmap_flags, tcp->u_arg[4] & MAP_TYPE, "MAP_???");
 		addflags(mmap_flags, tcp->u_arg[4] & ~MAP_TYPE);
 #else
-		printflags(mmap_flags, tcp->u_arg[4]);
+		printflags(mmap_flags, tcp->u_arg[4], "MAP_???");
 #endif
 	}
 	return 0;
@@ -729,8 +724,7 @@
 		printxval(policies, tcp->u_arg[2], "MPOL_???");
 		get_nodes(tcp, tcp->u_arg[3], tcp->u_arg[4], 0);
 		tprintf(", ");
-		if (printflags(mbindflags, tcp->u_arg[5]) == 0)
-			tprintf("0");
+		printflags(mbindflags, tcp->u_arg[5], "MPOL_???");
 	}
 	return 0;
 }
@@ -760,8 +754,7 @@
 			printxval(policies, pol, "MPOL_???");
 		get_nodes(tcp, tcp->u_arg[1], tcp->u_arg[2], syserror(tcp));
 		tprintf(", %#lx, ", tcp->u_arg[3]);
-		if (printflags(mempolicyflags, tcp->u_arg[4]) == 0)
-			tprintf("0");
+		printflags(mempolicyflags, tcp->u_arg[4], "MPOL_???");
 	}
 	return 0;
 }