summaryrefslogtreecommitdiff
path: root/time.c
diff options
context:
space:
mode:
authorRoland McGrath <roland@redhat.com>2007-07-24 01:57:11 +0000
committerRoland McGrath <roland@redhat.com>2007-07-24 01:57:11 +0000
commit6afc5659acc3df3d2e446ba4aa3a76bdd7264e1b (patch)
tree0cb461527501df4e852247ac911f95681e9b92ea /time.c
parentb912ffe5ccfb0b682f1c18f44f5cc1f0eb4cb1b9 (diff)
downloadstrace-6afc5659acc3df3d2e446ba4aa3a76bdd7264e1b.tar.gz
strace-6afc5659acc3df3d2e446ba4aa3a76bdd7264e1b.tar.bz2
strace-6afc5659acc3df3d2e446ba4aa3a76bdd7264e1b.tar.xz
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.
Diffstat (limited to 'time.c')
-rw-r--r--time.c37
1 files changed, 28 insertions, 9 deletions
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 @@ tprint_timeval(struct tcb *tcp, const struct timeval *tv)
}
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 @@ printtv_bitness(struct tcb *tcp, long addr, enum bitness_t bitness)
{
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 @@ struct tcb *tcp;
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 @@ sys_osf_settimeofday(tcp)
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;