* 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.
extern void printnum_int P((struct tcb *, long, char *));
extern void printpath P((struct tcb *, long));
extern void printpathn P((struct tcb *, long, int));
-extern void printtv_bitness P((struct tcb *, long, enum bitness_t));
+extern void printtv_bitness P((struct tcb *, long, enum bitness_t, int));
extern void sprinttv P((struct tcb *, long, enum bitness_t, char *));
#ifdef HAVE_SIGINFO_T
extern void printsiginfo P((siginfo_t *, int));
umoven((pid), (addr), sizeof *(objp), (char *) (objp))
#define printtv(tcp, addr) \
- printtv_bitness((tcp), (addr), BITNESS_CURRENT)
+ printtv_bitness((tcp), (addr), BITNESS_CURRENT, 0)
+#define printtv_special(tcp, addr) \
+ printtv_bitness((tcp), (addr), BITNESS_CURRENT, 1)
#ifdef __STDC__
#ifdef __GNUC__
}
free(fds);
tprintf(", ");
- printtv_bitness(tcp, args[4], bitness);
+ printtv_bitness(tcp, args[4], bitness, 0);
}
else
{
{ AT_SYMLINK_NOFOLLOW, "AT_SYMLINK_NOFOLLOW" },
{ 0, NULL },
};
+#define utimensatflags fstatatflags
int
sys_newfstatat(struct tcb *tcp)
if (entering(tcp)) {
printpath(tcp, tcp->u_arg[0]);
tprintf(", ");
- printtv_bitness(tcp, tcp->u_arg[1], BITNESS_32);
+ printtv_bitness(tcp, tcp->u_arg[1], BITNESS_32, 0);
}
return 0;
}
#endif
static int
-decode_utimes(struct tcb *tcp, int offset)
+decode_utimes(struct tcb *tcp, int offset, int special)
{
if (entering(tcp)) {
printpath(tcp, tcp->u_arg[offset]);
tprintf(", ");
- printtv(tcp, tcp->u_arg[offset + 1]);
+ if (tcp->u_arg[offset + 1] == 0)
+ tprintf("NULL");
+ else {
+ tprintf("{");
+ printtv_bitness(tcp, tcp->u_arg[offset + 1],
+ BITNESS_CURRENT, special);
+ tprintf(", ");
+ printtv_bitness(tcp, tcp->u_arg[offset + 1]
+ + sizeof (struct timeval),
+ BITNESS_CURRENT, special);
+ tprintf("}");
+ }
}
return 0;
}
int
sys_utimes(struct tcb *tcp)
{
- return decode_utimes(tcp, 0);
+ return decode_utimes(tcp, 0, 0);
}
#ifdef LINUX
{
if (entering(tcp))
print_dirfd(tcp->u_arg[0]);
- return decode_utimes(tcp, 1);
+ return decode_utimes(tcp, 1, 0);
+}
+
+int
+sys_utimensat(struct tcb *tcp)
+{
+ if (entering(tcp)) {
+ print_dirfd(tcp->u_arg[0]);
+ decode_utimes(tcp, 1, 1);
+ tprintf(", ");
+ printflags(utimensatflags, tcp->u_arg[3], "AT_???");
+ }
+ return 0;
}
#endif
int sys_mbind(), sys_get_mempolicy(), sys_set_mempolicy(), sys_move_pages();
int sys_arch_prctl();
int sys_io_setup(), sys_io_submit(), sys_io_cancel(), sys_io_getevents(), sys_io_destroy();
+int sys_utimensat();
/* sys_socketcall subcalls */
{ 6, 0, sys_move_pages, "move_pages" }, /* 317 */
{ 5, 0, printargs, "SYS_318" }, /* 318 */
{ 5, 0, printargs, "SYS_319" }, /* 319 */
- { 5, 0, printargs, "SYS_320" }, /* 320 */
+ { 4, TD|TF, sys_utimensat, "utimensat" }, /* 320 */
{ 5, 0, printargs, "SYS_321" }, /* 321 */
{ 5, 0, printargs, "SYS_322" }, /* 322 */
{ 5, 0, printargs, "SYS_323" }, /* 323 */
{ 4, TD, printargs, "tee" }, /* 277 */
{ 4, TD, printargs, "vmsplice" }, /* 278 */
{ 6, 0, sys_move_pages, "move_pages" }, /* 279 */
+ { 4, TD|TF, sys_utimensat, "utimensat" }, /* 280 */
#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
}
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");
{
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)
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;
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;