2007-07-23  Ulrich Drepper  <drepper@redhat.com>

	* defs.h: Add new parameter to printtv_bitness prototype.
	(printttv): Pass zero for the new parameter.
	(printtv_special): New macro.
	* desc.c (decode_select): Pass zero for the new parameter of
	printtv_bitness.
	* file.c (utimensatflags): New macro.
	(sys_osf_utimes): Pass zero for the new parameter of
	printtv_bitness.
	(sys_utimes): Likewise.
	(sys_futimesat): Likewise.
	(decode_utimes): Add new parameter.  Pass it to the
	printtv_bitness calls.  Fix printing of time values.
	(sys_utimensat): New function.
	* time.c (UTIME_NOW, UTIME_OMIT): Define if not already
	happened.
	(printtv_bitness): Add new parameter.  Print special UTIME_*
	values as strings if set.
	(sys_osf_gettimeofday): Pass zero for the new parameter of
	printtv_bitness.
	(sys_osf_settimeofday): Likewise.
	* linux/syscall.h: Declare sys_utimensat.
	* linux/syscallent.h: Add utimensat entry.
	* linux/x86_64/syscallent.h: Likewise.
diff --git a/time.c b/time.c
index 3d2f6c9..b4c6acf 100644
--- a/time.c
+++ b/time.c
@@ -36,6 +36,13 @@
 #include <sys/timex.h>
 #include <linux/ioctl.h>
 #include <linux/rtc.h>
+
+#ifndef UTIME_NOW
+#define UTIME_NOW ((1l << 30) - 1l)
+#endif
+#ifndef UTIME_OMIT
+#define UTIME_OMIT ((1l << 30) - 2l)
+#endif
 #endif /* LINUX */
 
 struct timeval32
@@ -57,7 +64,7 @@
 }
 
 void
-printtv_bitness(struct tcb *tcp, long addr, enum bitness_t bitness)
+printtv_bitness(struct tcb *tcp, long addr, enum bitness_t bitness, int special)
 {
 	if (addr == 0)
 		tprintf("NULL");
@@ -75,14 +82,26 @@
 		{
 			struct timeval32 tv;
 
-			if ((rc = umove(tcp, addr, &tv)) >= 0)
-				tprint_timeval32(tcp, &tv);
+			if ((rc = umove(tcp, addr, &tv)) >= 0) {
+				if (special && tv.tv_usec == UTIME_NOW)
+					tprintf("UTIME_NOW");
+				else if (special && tv.tv_usec == UTIME_OMIT)
+					tprintf("UTIME_OMIT");
+				else
+					tprint_timeval32(tcp, &tv);
+			}
 		} else
 		{
 			struct timeval tv;
 
-			if ((rc = umove(tcp, addr, &tv)) >= 0)
-				tprint_timeval(tcp, &tv);
+			if ((rc = umove(tcp, addr, &tv)) >= 0) {
+				if (special && tv.tv_usec == UTIME_NOW)
+					tprintf("UTIME_NOW");
+				else if (special && tv.tv_usec == UTIME_OMIT)
+					tprintf("UTIME_OMIT");
+				else
+					tprint_timeval(tcp, &tv);
+			}
 		}
 
 		if (rc < 0)
@@ -180,10 +199,10 @@
 		    tcp->u_arg[0], tcp->u_arg[1]);
 	    return 0;
 	}
-	printtv_bitness(tcp, tcp->u_arg[0], BITNESS_32);
+	printtv_bitness(tcp, tcp->u_arg[0], BITNESS_32, 0);
 #ifndef SVR4
 	tprintf(", ");
-	printtv_bitness(tcp, tcp->u_arg[1], BITNESS_32);
+	printtv_bitness(tcp, tcp->u_arg[1], BITNESS_32, 0);
 #endif /* !SVR4 */
     }
     return 0;
@@ -210,10 +229,10 @@
 struct tcb *tcp;
 {
     if (entering(tcp)) {
-	printtv_bitness(tcp, tcp->u_arg[0], BITNESS_32);
+	printtv_bitness(tcp, tcp->u_arg[0], BITNESS_32, 0);
 #ifndef SVR4
 	tprintf(", ");
-	printtv_bitness(tcp, tcp->u_arg[1], BITNESS_32);
+	printtv_bitness(tcp, tcp->u_arg[1], BITNESS_32, 0);
 #endif /* !SVR4 */
     }
     return 0;