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

* time.c (printitv_bitness): Add missing braces to enclose
	conditional code.
	(TDF_TIMER_ABSTIME): Define if not already.
	(timerfdflags): New variable.
	(sys_timerfd): New function.
	* linux/syscall.h: Declare sys_timerfd.
	* linux/syscallent.h: Add timerfd entry.
	* linux/x86_64/syscallent.h: Likewise.
This commit is contained in:
Roland McGrath 2007-08-02 01:25:34 +00:00
parent 488a140828
commit e466234035
4 changed files with 32 additions and 4 deletions

View File

@ -102,7 +102,7 @@ int sys_waitid(), sys_fadvise64(), sys_fadvise64_64();
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_epoll_pwait(), sys_signalfd();
int sys_utimensat(), sys_epoll_pwait(), sys_signalfd(), sys_timerfd();
/* sys_socketcall subcalls */

View File

@ -352,7 +352,7 @@
{ 5, TD, sys_epoll_pwait, "epoll_pwait" }, /* 319 */
{ 4, TD|TF, sys_utimensat, "utimensat" }, /* 320 */
{ 3, TD|TS, sys_signalfd, "signalfd" }, /* 321 */
{ 5, 0, printargs, "SYS_322" }, /* 322 */
{ 4, TD, sys_timerfd, "timerfd" }, /* 322 */
{ 5, 0, printargs, "SYS_323" }, /* 323 */
{ 5, 0, printargs, "SYS_324" }, /* 324 */
{ 5, 0, printargs, "SYS_325" }, /* 325 */

View File

@ -281,3 +281,4 @@
{ 4, TD|TF, sys_utimensat, "utimensat" }, /* 280 */
{ 5, TD, sys_epoll_pwait, "epoll_pwait" }, /* 281 */
{ 3, TD|TS, sys_signalfd, "signalfd" }, /* 282 */
{ 4, TD, sys_timerfd, "timerfd" }, /* 283 */

31
time.c
View File

@ -288,22 +288,24 @@ printitv_bitness(struct tcb *tcp, long addr, enum bitness_t bitness)
struct timeval32 it_interval, it_value;
} itv;
if ((rc = umove(tcp, addr, &itv)) >= 0)
if ((rc = umove(tcp, addr, &itv)) >= 0) {
tprintf("{it_interval=");
tprint_timeval32(tcp, &itv.it_interval);
tprintf(", it_value=");
tprint_timeval32(tcp, &itv.it_value);
tprintf("}");
}
} else
{
struct itimerval itv;
if ((rc = umove(tcp, addr, &itv)) >= 0)
if ((rc = umove(tcp, addr, &itv)) >= 0) {
tprintf("{it_interval=");
tprint_timeval(tcp, &itv.it_interval);
tprintf(", it_value=");
tprint_timeval(tcp, &itv.it_value);
tprintf("}");
}
}
if (rc < 0)
@ -892,4 +894,29 @@ long arg;
}
return 1;
}
#ifndef TFD_TIMER_ABSTIME
#define TFD_TIMER_ABSTIME (1 << 0)
#endif
static const struct xlat timerfdflags[] = {
{ TFD_TIMER_ABSTIME, "TFD_TIMER_ABSTIME" },
{ 0, NULL }
};
int
sys_timerfd(tcp)
struct tcb *tcp;
{
if (entering(tcp)) {
/* It does not matter that the kernel uses itimerspec. */
tprintf("%ld, ", tcp->u_arg[0]);
printxval(clocknames, tcp->u_arg[1], "CLOCK_???");
tprintf(", ");
printflags(timerfdflags, tcp->u_arg[2], "TFD_???");
tprintf(", ");
printitv(tcp, tcp->u_arg[3]);
}
return 0;
}
#endif /* LINUX */