blob: 1560bde906e120d75e45cf8284ebdec4c6276983 [file] [log] [blame]
Wichert Akkerman76baf7c1999-02-19 00:21:36 +00001/*
2 * Copyright (c) 1991, 1992 Paul Kranenburg <pk@cs.few.eur.nl>
3 * Copyright (c) 1993 Branko Lankester <branko@hacktic.nl>
4 * Copyright (c) 1993, 1994, 1995, 1996 Rick Sladkey <jrs@world.std.com>
5 * All rights reserved.
6 *
7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions
9 * are met:
10 * 1. Redistributions of source code must retain the above copyright
11 * notice, this list of conditions and the following disclaimer.
12 * 2. Redistributions in binary form must reproduce the above copyright
13 * notice, this list of conditions and the following disclaimer in the
14 * documentation and/or other materials provided with the distribution.
15 * 3. The name of the author may not be used to endorse or promote products
16 * derived from this software without specific prior written permission.
17 *
18 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
19 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
20 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
21 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
22 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
23 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
24 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
25 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
26 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
27 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28 *
29 * $Id$
30 */
31
32#include "defs.h"
33
34#ifdef LINUX
35#include <linux/version.h>
Wichert Akkermand856b992000-10-13 12:47:12 +000036#include <sys/timex.h>
Roland McGrathd83c50b2004-10-06 22:27:43 +000037#include <linux/ioctl.h>
38#include <linux/rtc.h>
Roland McGrath6afc5652007-07-24 01:57:11 +000039
40#ifndef UTIME_NOW
41#define UTIME_NOW ((1l << 30) - 1l)
42#endif
43#ifndef UTIME_OMIT
44#define UTIME_OMIT ((1l << 30) - 2l)
45#endif
Wichert Akkerman76baf7c1999-02-19 00:21:36 +000046#endif /* LINUX */
47
Dmitry V. Levina7945a32006-12-13 17:10:11 +000048struct timeval32
Wichert Akkerman76baf7c1999-02-19 00:21:36 +000049{
Dmitry V. Levina7945a32006-12-13 17:10:11 +000050 u_int32_t tv_sec, tv_usec;
51};
Wichert Akkerman76baf7c1999-02-19 00:21:36 +000052
Dmitry V. Levin1cad25d2006-12-13 17:14:36 +000053static void
54tprint_timeval32(struct tcb *tcp, const struct timeval32 *tv)
55{
56 tprintf("{%u, %u}", tv->tv_sec, tv->tv_usec);
57}
58
59static void
60tprint_timeval(struct tcb *tcp, const struct timeval *tv)
61{
62 tprintf("{%lu, %lu}",
63 (unsigned long) tv->tv_sec, (unsigned long) tv->tv_usec);
64}
65
Dmitry V. Levina7945a32006-12-13 17:10:11 +000066void
Roland McGrath6afc5652007-07-24 01:57:11 +000067printtv_bitness(struct tcb *tcp, long addr, enum bitness_t bitness, int special)
Dmitry V. Levina7945a32006-12-13 17:10:11 +000068{
Wichert Akkerman76baf7c1999-02-19 00:21:36 +000069 if (addr == 0)
70 tprintf("NULL");
71 else if (!verbose(tcp))
72 tprintf("%#lx", addr);
Denys Vlasenko1d632462009-04-14 12:51:00 +000073 else {
74 int rc;
Wichert Akkerman76baf7c1999-02-19 00:21:36 +000075
Dmitry V. Levina7945a32006-12-13 17:10:11 +000076 if (bitness == BITNESS_32
77#if defined(LINUX) && SUPPORTED_PERSONALITIES > 1
78 || personality_wordsize[current_personality] == 4
79#endif
80 )
81 {
82 struct timeval32 tv;
83
Roland McGrath6afc5652007-07-24 01:57:11 +000084 if ((rc = umove(tcp, addr, &tv)) >= 0) {
Roland McGrath41383392007-07-24 01:58:52 +000085 if (special && tv.tv_sec == 0 &&
86 tv.tv_usec == UTIME_NOW)
Roland McGrath6afc5652007-07-24 01:57:11 +000087 tprintf("UTIME_NOW");
Roland McGrath41383392007-07-24 01:58:52 +000088 else if (special && tv.tv_sec == 0 &&
89 tv.tv_usec == UTIME_OMIT)
Roland McGrath6afc5652007-07-24 01:57:11 +000090 tprintf("UTIME_OMIT");
91 else
92 tprint_timeval32(tcp, &tv);
93 }
Denys Vlasenko1d632462009-04-14 12:51:00 +000094 } else {
Dmitry V. Levina7945a32006-12-13 17:10:11 +000095 struct timeval tv;
96
Roland McGrath6afc5652007-07-24 01:57:11 +000097 if ((rc = umove(tcp, addr, &tv)) >= 0) {
Roland McGrath41383392007-07-24 01:58:52 +000098 if (special && tv.tv_sec == 0 &&
99 tv.tv_usec == UTIME_NOW)
Roland McGrath6afc5652007-07-24 01:57:11 +0000100 tprintf("UTIME_NOW");
Roland McGrath41383392007-07-24 01:58:52 +0000101 else if (special && tv.tv_sec == 0 &&
102 tv.tv_usec == UTIME_OMIT)
Roland McGrath6afc5652007-07-24 01:57:11 +0000103 tprintf("UTIME_OMIT");
104 else
105 tprint_timeval(tcp, &tv);
106 }
Dmitry V. Levina7945a32006-12-13 17:10:11 +0000107 }
Dmitry V. Levina7945a32006-12-13 17:10:11 +0000108 if (rc < 0)
109 tprintf("{...}");
110 }
111}
Wichert Akkerman221f54f1999-11-18 17:26:45 +0000112
Wichert Akkermanf5eeabb1999-11-18 17:09:47 +0000113void
Dmitry V. Levina7945a32006-12-13 17:10:11 +0000114sprinttv(struct tcb *tcp, long addr, enum bitness_t bitness, char *buf)
Wichert Akkermanf5eeabb1999-11-18 17:09:47 +0000115{
Dmitry V. Levina7945a32006-12-13 17:10:11 +0000116 if (addr == 0)
117 strcpy(buf, "NULL");
118 else if (!verbose(tcp))
119 sprintf(buf, "%#lx", addr);
Denys Vlasenko1d632462009-04-14 12:51:00 +0000120 else {
121 int rc;
Wichert Akkermanf5eeabb1999-11-18 17:09:47 +0000122
Dmitry V. Levina7945a32006-12-13 17:10:11 +0000123 if (bitness == BITNESS_32
124#if defined(LINUX) && SUPPORTED_PERSONALITIES > 1
125 || personality_wordsize[current_personality] == 4
Wichert Akkermanf5eeabb1999-11-18 17:09:47 +0000126#endif
Dmitry V. Levina7945a32006-12-13 17:10:11 +0000127 )
128 {
129 struct timeval32 tv;
Wichert Akkermanf5eeabb1999-11-18 17:09:47 +0000130
Dmitry V. Levina7945a32006-12-13 17:10:11 +0000131 if ((rc = umove(tcp, addr, &tv)) >= 0)
132 sprintf(buf, "{%u, %u}",
133 tv.tv_sec, tv.tv_usec);
Denys Vlasenko1d632462009-04-14 12:51:00 +0000134 } else {
Dmitry V. Levina7945a32006-12-13 17:10:11 +0000135 struct timeval tv;
136
137 if ((rc = umove(tcp, addr, &tv)) >= 0)
138 sprintf(buf, "{%lu, %lu}",
139 (unsigned long) tv.tv_sec,
140 (unsigned long) tv.tv_usec);
141 }
Dmitry V. Levina7945a32006-12-13 17:10:11 +0000142 if (rc < 0)
143 strcpy(buf, "{...}");
144 }
145}
Wichert Akkermanf5eeabb1999-11-18 17:09:47 +0000146
Denys Vlasenko1d632462009-04-14 12:51:00 +0000147void print_timespec(struct tcb *tcp, long addr)
Roland McGrath6bc09da2007-11-01 21:50:54 +0000148{
149 if (addr == 0)
150 tprintf("NULL");
151 else if (!verbose(tcp))
152 tprintf("%#lx", addr);
153 else {
Denys Vlasenko1d632462009-04-14 12:51:00 +0000154 int rc;
Roland McGrath6bc09da2007-11-01 21:50:54 +0000155
156#if defined(LINUX) && SUPPORTED_PERSONALITIES > 1
Denys Vlasenko1d632462009-04-14 12:51:00 +0000157 if (personality_wordsize[current_personality] == 4) {
Roland McGrath6bc09da2007-11-01 21:50:54 +0000158 struct timeval32 tv;
159
160 if ((rc = umove(tcp, addr, &tv)) >= 0)
161 tprintf("{%u, %u}",
162 tv.tv_sec, tv.tv_usec);
163 } else
Roland McGrath6bc09da2007-11-01 21:50:54 +0000164#endif
Denys Vlasenko1d632462009-04-14 12:51:00 +0000165 {
Roland McGrath6bc09da2007-11-01 21:50:54 +0000166 struct timespec ts;
167
168 if ((rc = umove(tcp, addr, &ts)) >= 0)
169 tprintf("{%lu, %lu}",
170 (unsigned long) ts.tv_sec,
171 (unsigned long) ts.tv_nsec);
Roland McGrath6bc09da2007-11-01 21:50:54 +0000172 }
Roland McGrath6bc09da2007-11-01 21:50:54 +0000173 if (rc < 0)
174 tprintf("{...}");
175 }
176}
177
Denys Vlasenko1d632462009-04-14 12:51:00 +0000178void sprint_timespec(char *buf, struct tcb *tcp, long addr)
Roland McGrath6bc09da2007-11-01 21:50:54 +0000179{
180 if (addr == 0)
181 strcpy(buf, "NULL");
182 else if (!verbose(tcp))
183 sprintf(buf, "%#lx", addr);
184 else {
Denys Vlasenko1d632462009-04-14 12:51:00 +0000185 int rc;
Roland McGrath6bc09da2007-11-01 21:50:54 +0000186
187#if defined(LINUX) && SUPPORTED_PERSONALITIES > 1
Denys Vlasenko1d632462009-04-14 12:51:00 +0000188 if (personality_wordsize[current_personality] == 4) {
Roland McGrath6bc09da2007-11-01 21:50:54 +0000189 struct timeval32 tv;
190
191 if ((rc = umove(tcp, addr, &tv)) >= 0)
192 sprintf(buf, "{%u, %u}",
193 tv.tv_sec, tv.tv_usec);
194 } else
Roland McGrath6bc09da2007-11-01 21:50:54 +0000195#endif
Denys Vlasenko1d632462009-04-14 12:51:00 +0000196 {
Roland McGrath6bc09da2007-11-01 21:50:54 +0000197 struct timespec ts;
198
199 if ((rc = umove(tcp, addr, &ts)) >= 0)
200 sprintf(buf, "{%lu, %lu}",
201 (unsigned long) ts.tv_sec,
202 (unsigned long) ts.tv_nsec);
Roland McGrath6bc09da2007-11-01 21:50:54 +0000203 }
Roland McGrath6bc09da2007-11-01 21:50:54 +0000204 if (rc < 0)
205 strcpy(buf, "{...}");
206 }
207}
208
Wichert Akkerman76baf7c1999-02-19 00:21:36 +0000209int
Denys Vlasenko12014262011-05-30 14:00:14 +0200210sys_time(struct tcb *tcp)
Wichert Akkerman76baf7c1999-02-19 00:21:36 +0000211{
212 if (exiting(tcp)) {
213#ifndef SVR4
214 printnum(tcp, tcp->u_arg[0], "%ld");
215#endif /* SVR4 */
216 }
217 return 0;
218}
219
220int
Denys Vlasenko12014262011-05-30 14:00:14 +0200221sys_stime(struct tcb *tcp)
Wichert Akkerman76baf7c1999-02-19 00:21:36 +0000222{
223 if (exiting(tcp)) {
224 printnum(tcp, tcp->u_arg[0], "%ld");
225 }
226 return 0;
227}
228
229int
Denys Vlasenko12014262011-05-30 14:00:14 +0200230sys_gettimeofday(struct tcb *tcp)
Wichert Akkerman76baf7c1999-02-19 00:21:36 +0000231{
232 if (exiting(tcp)) {
233 if (syserror(tcp)) {
234 tprintf("%#lx, %#lx",
235 tcp->u_arg[0], tcp->u_arg[1]);
236 return 0;
237 }
238 printtv(tcp, tcp->u_arg[0]);
239#ifndef SVR4
240 tprintf(", ");
241 printtv(tcp, tcp->u_arg[1]);
242#endif /* !SVR4 */
243 }
244 return 0;
245}
246
Wichert Akkermanf5eeabb1999-11-18 17:09:47 +0000247
248#ifdef ALPHA
249int
Denys Vlasenko12014262011-05-30 14:00:14 +0200250sys_osf_gettimeofday(struct tcb *tcp)
Wichert Akkermanf5eeabb1999-11-18 17:09:47 +0000251{
Denys Vlasenko1d632462009-04-14 12:51:00 +0000252 if (exiting(tcp)) {
253 if (syserror(tcp)) {
254 tprintf("%#lx, %#lx", tcp->u_arg[0], tcp->u_arg[1]);
255 return 0;
256 }
257 printtv_bitness(tcp, tcp->u_arg[0], BITNESS_32, 0);
Wichert Akkermanf5eeabb1999-11-18 17:09:47 +0000258#ifndef SVR4
Denys Vlasenko1d632462009-04-14 12:51:00 +0000259 tprintf(", ");
260 printtv_bitness(tcp, tcp->u_arg[1], BITNESS_32, 0);
Wichert Akkermanf5eeabb1999-11-18 17:09:47 +0000261#endif /* !SVR4 */
Denys Vlasenko1d632462009-04-14 12:51:00 +0000262 }
263 return 0;
Wichert Akkermanf5eeabb1999-11-18 17:09:47 +0000264}
265#endif
266
Wichert Akkerman76baf7c1999-02-19 00:21:36 +0000267int
Denys Vlasenko12014262011-05-30 14:00:14 +0200268sys_settimeofday(struct tcb *tcp)
Wichert Akkerman76baf7c1999-02-19 00:21:36 +0000269{
270 if (entering(tcp)) {
271 printtv(tcp, tcp->u_arg[0]);
272#ifndef SVR4
273 tprintf(", ");
274 printtv(tcp, tcp->u_arg[1]);
275#endif /* !SVR4 */
276 }
277 return 0;
278}
279
Wichert Akkermanf5eeabb1999-11-18 17:09:47 +0000280#ifdef ALPHA
281int
Denys Vlasenko12014262011-05-30 14:00:14 +0200282sys_osf_settimeofday(struct tcb *tcp)
Wichert Akkermanf5eeabb1999-11-18 17:09:47 +0000283{
Denys Vlasenko1d632462009-04-14 12:51:00 +0000284 if (entering(tcp)) {
285 printtv_bitness(tcp, tcp->u_arg[0], BITNESS_32, 0);
Wichert Akkermanf5eeabb1999-11-18 17:09:47 +0000286#ifndef SVR4
Denys Vlasenko1d632462009-04-14 12:51:00 +0000287 tprintf(", ");
288 printtv_bitness(tcp, tcp->u_arg[1], BITNESS_32, 0);
Wichert Akkermanf5eeabb1999-11-18 17:09:47 +0000289#endif /* !SVR4 */
Denys Vlasenko1d632462009-04-14 12:51:00 +0000290 }
291 return 0;
Wichert Akkermanf5eeabb1999-11-18 17:09:47 +0000292}
293#endif
294
Wichert Akkerman76baf7c1999-02-19 00:21:36 +0000295int
Denys Vlasenko12014262011-05-30 14:00:14 +0200296sys_adjtime(struct tcb *tcp)
Wichert Akkerman76baf7c1999-02-19 00:21:36 +0000297{
298 if (entering(tcp)) {
299 printtv(tcp, tcp->u_arg[0]);
300 tprintf(", ");
301 } else {
302 if (syserror(tcp))
303 tprintf("%#lx", tcp->u_arg[1]);
304 else
305 printtv(tcp, tcp->u_arg[1]);
306 }
307 return 0;
308}
309
Dmitry V. Levin2e55ff42008-09-03 01:02:46 +0000310int
311sys_nanosleep(struct tcb *tcp)
312{
313 if (entering(tcp)) {
314 print_timespec(tcp, tcp->u_arg[0]);
315 tprintf(", ");
316 } else {
317 if (!tcp->u_arg[1] || is_restart_error(tcp))
318 print_timespec(tcp, tcp->u_arg[1]);
319 else
320 tprintf("%#lx", tcp->u_arg[1]);
321 }
322 return 0;
323}
324
Roland McGrathd9f816f2004-09-04 03:39:20 +0000325static const struct xlat which[] = {
Wichert Akkerman76baf7c1999-02-19 00:21:36 +0000326 { ITIMER_REAL, "ITIMER_REAL" },
327 { ITIMER_VIRTUAL,"ITIMER_VIRTUAL"},
328 { ITIMER_PROF, "ITIMER_PROF" },
329 { 0, NULL },
330};
331
332static void
Dmitry V. Levin1cad25d2006-12-13 17:14:36 +0000333printitv_bitness(struct tcb *tcp, long addr, enum bitness_t bitness)
Wichert Akkerman76baf7c1999-02-19 00:21:36 +0000334{
Wichert Akkerman76baf7c1999-02-19 00:21:36 +0000335 if (addr == 0)
336 tprintf("NULL");
337 else if (!verbose(tcp))
338 tprintf("%#lx", addr);
Denys Vlasenko1d632462009-04-14 12:51:00 +0000339 else {
340 int rc;
Dmitry V. Levin1cad25d2006-12-13 17:14:36 +0000341
342 if (bitness == BITNESS_32
343#if defined(LINUX) && SUPPORTED_PERSONALITIES > 1
344 || personality_wordsize[current_personality] == 4
345#endif
346 )
347 {
Denys Vlasenko1d632462009-04-14 12:51:00 +0000348 struct {
Dmitry V. Levin1cad25d2006-12-13 17:14:36 +0000349 struct timeval32 it_interval, it_value;
350 } itv;
351
Roland McGrathe4662342007-08-02 01:25:34 +0000352 if ((rc = umove(tcp, addr, &itv)) >= 0) {
Dmitry V. Levin1cad25d2006-12-13 17:14:36 +0000353 tprintf("{it_interval=");
354 tprint_timeval32(tcp, &itv.it_interval);
355 tprintf(", it_value=");
356 tprint_timeval32(tcp, &itv.it_value);
357 tprintf("}");
Roland McGrathe4662342007-08-02 01:25:34 +0000358 }
Denys Vlasenko1d632462009-04-14 12:51:00 +0000359 } else {
Dmitry V. Levin1cad25d2006-12-13 17:14:36 +0000360 struct itimerval itv;
361
Roland McGrathe4662342007-08-02 01:25:34 +0000362 if ((rc = umove(tcp, addr, &itv)) >= 0) {
Dmitry V. Levin1cad25d2006-12-13 17:14:36 +0000363 tprintf("{it_interval=");
364 tprint_timeval(tcp, &itv.it_interval);
365 tprintf(", it_value=");
366 tprint_timeval(tcp, &itv.it_value);
367 tprintf("}");
Roland McGrathe4662342007-08-02 01:25:34 +0000368 }
Dmitry V. Levin1cad25d2006-12-13 17:14:36 +0000369 }
Dmitry V. Levin1cad25d2006-12-13 17:14:36 +0000370 if (rc < 0)
371 tprintf("{...}");
Wichert Akkerman76baf7c1999-02-19 00:21:36 +0000372 }
373}
374
Dmitry V. Levin1cad25d2006-12-13 17:14:36 +0000375#define printitv(tcp, addr) \
376 printitv_bitness((tcp), (addr), BITNESS_CURRENT)
Wichert Akkermanf5eeabb1999-11-18 17:09:47 +0000377
Wichert Akkerman76baf7c1999-02-19 00:21:36 +0000378int
Denys Vlasenko12014262011-05-30 14:00:14 +0200379sys_getitimer(struct tcb *tcp)
Wichert Akkerman76baf7c1999-02-19 00:21:36 +0000380{
381 if (entering(tcp)) {
382 printxval(which, tcp->u_arg[0], "ITIMER_???");
383 tprintf(", ");
384 } else {
385 if (syserror(tcp))
386 tprintf("%#lx", tcp->u_arg[1]);
387 else
388 printitv(tcp, tcp->u_arg[1]);
389 }
390 return 0;
391}
392
Wichert Akkermanf5eeabb1999-11-18 17:09:47 +0000393
394#ifdef ALPHA
395int
Denys Vlasenko12014262011-05-30 14:00:14 +0200396sys_osf_getitimer(struct tcb *tcp)
Wichert Akkermanf5eeabb1999-11-18 17:09:47 +0000397{
Denys Vlasenko1d632462009-04-14 12:51:00 +0000398 if (entering(tcp)) {
399 printxval(which, tcp->u_arg[0], "ITIMER_???");
400 tprintf(", ");
401 } else {
402 if (syserror(tcp))
403 tprintf("%#lx", tcp->u_arg[1]);
404 else
405 printitv_bitness(tcp, tcp->u_arg[1], BITNESS_32);
406 }
407 return 0;
Wichert Akkermanf5eeabb1999-11-18 17:09:47 +0000408}
409#endif
410
Wichert Akkerman76baf7c1999-02-19 00:21:36 +0000411int
Denys Vlasenko12014262011-05-30 14:00:14 +0200412sys_setitimer(struct tcb *tcp)
Wichert Akkerman76baf7c1999-02-19 00:21:36 +0000413{
414 if (entering(tcp)) {
415 printxval(which, tcp->u_arg[0], "ITIMER_???");
416 tprintf(", ");
417 printitv(tcp, tcp->u_arg[1]);
418 tprintf(", ");
419 } else {
420 if (syserror(tcp))
421 tprintf("%#lx", tcp->u_arg[2]);
422 else
423 printitv(tcp, tcp->u_arg[2]);
424 }
425 return 0;
426}
427
Wichert Akkermanf5eeabb1999-11-18 17:09:47 +0000428#ifdef ALPHA
429int
Denys Vlasenko12014262011-05-30 14:00:14 +0200430sys_osf_setitimer(struct tcb *tcp)
Wichert Akkermanf5eeabb1999-11-18 17:09:47 +0000431{
Denys Vlasenko1d632462009-04-14 12:51:00 +0000432 if (entering(tcp)) {
433 printxval(which, tcp->u_arg[0], "ITIMER_???");
434 tprintf(", ");
435 printitv_bitness(tcp, tcp->u_arg[1], BITNESS_32);
436 tprintf(", ");
437 } else {
438 if (syserror(tcp))
439 tprintf("%#lx", tcp->u_arg[2]);
440 else
441 printitv_bitness(tcp, tcp->u_arg[2], BITNESS_32);
442 }
443 return 0;
Wichert Akkermanf5eeabb1999-11-18 17:09:47 +0000444}
445#endif
446
Wichert Akkerman76baf7c1999-02-19 00:21:36 +0000447#ifdef LINUX
448
Dmitry V. Levin1a684d62006-12-13 17:42:32 +0000449static const struct xlat adjtimex_modes[] = {
450 { 0, "0" },
451#ifdef ADJ_OFFSET
452 { ADJ_OFFSET, "ADJ_OFFSET" },
453#endif
454#ifdef ADJ_FREQUENCY
455 { ADJ_FREQUENCY, "ADJ_FREQUENCY" },
456#endif
457#ifdef ADJ_MAXERROR
458 { ADJ_MAXERROR, "ADJ_MAXERROR" },
459#endif
460#ifdef ADJ_ESTERROR
461 { ADJ_ESTERROR, "ADJ_ESTERROR" },
462#endif
463#ifdef ADJ_STATUS
464 { ADJ_STATUS, "ADJ_STATUS" },
465#endif
466#ifdef ADJ_TIMECONST
467 { ADJ_TIMECONST, "ADJ_TIMECONST" },
468#endif
469#ifdef ADJ_TICK
470 { ADJ_TICK, "ADJ_TICK" },
471#endif
472#ifdef ADJ_OFFSET_SINGLESHOT
473 { ADJ_OFFSET_SINGLESHOT, "ADJ_OFFSET_SINGLESHOT" },
474#endif
475 { 0, NULL }
476};
477
478static const struct xlat adjtimex_status[] = {
479#ifdef STA_PLL
480 { STA_PLL, "STA_PLL" },
481#endif
482#ifdef STA_PPSFREQ
483 { STA_PPSFREQ, "STA_PPSFREQ" },
484#endif
485#ifdef STA_PPSTIME
486 { STA_PPSTIME, "STA_PPSTIME" },
487#endif
488#ifdef STA_FLL
489 { STA_FLL, "STA_FLL" },
490#endif
491#ifdef STA_INS
492 { STA_INS, "STA_INS" },
493#endif
494#ifdef STA_DEL
495 { STA_DEL, "STA_DEL" },
496#endif
497#ifdef STA_UNSYNC
498 { STA_UNSYNC, "STA_UNSYNC" },
499#endif
500#ifdef STA_FREQHOLD
501 { STA_FREQHOLD, "STA_FREQHOLD" },
502#endif
503#ifdef STA_PPSSIGNAL
504 { STA_PPSSIGNAL, "STA_PPSSIGNAL" },
505#endif
506#ifdef STA_PPSJITTER
507 { STA_PPSJITTER, "STA_PPSJITTER" },
508#endif
509#ifdef STA_PPSWANDER
510 { STA_PPSWANDER, "STA_PPSWANDER" },
511#endif
512#ifdef STA_PPSERROR
513 { STA_PPSERROR, "STA_PPSERROR" },
514#endif
515#ifdef STA_CLOCKERR
516 { STA_CLOCKERR, "STA_CLOCKERR" },
517#endif
518 { 0, NULL }
519};
520
521static const struct xlat adjtimex_state[] = {
522#ifdef TIME_OK
523 { TIME_OK, "TIME_OK" },
524#endif
525#ifdef TIME_INS
526 { TIME_INS, "TIME_INS" },
527#endif
528#ifdef TIME_DEL
529 { TIME_DEL, "TIME_DEL" },
530#endif
531#ifdef TIME_OOP
532 { TIME_OOP, "TIME_OOP" },
533#endif
534#ifdef TIME_WAIT
535 { TIME_WAIT, "TIME_WAIT" },
536#endif
537#ifdef TIME_ERROR
538 { TIME_ERROR, "TIME_ERROR" },
539#endif
540 { 0, NULL }
541};
542
Dmitry V. Levin165b15d2006-12-13 17:43:45 +0000543#if SUPPORTED_PERSONALITIES > 1
544static int
545tprint_timex32(struct tcb *tcp, long addr)
546{
Denys Vlasenko1d632462009-04-14 12:51:00 +0000547 struct {
Dmitry V. Levin165b15d2006-12-13 17:43:45 +0000548 unsigned int modes;
549 int offset;
550 int freq;
551 int maxerror;
552 int esterror;
553 int status;
554 int constant;
555 int precision;
556 int tolerance;
557 struct timeval32 time;
558 int tick;
559 int ppsfreq;
560 int jitter;
561 int shift;
562 int stabil;
563 int jitcnt;
564 int calcnt;
565 int errcnt;
566 int stbcnt;
567 } tx;
568
569 if (umove(tcp, addr, &tx) < 0)
570 return -1;
571
572 tprintf("{modes=");
Dmitry V. Levin71d70892007-01-13 11:17:38 +0000573 printflags(adjtimex_modes, tx.modes, "ADJ_???");
Dmitry V. Levin165b15d2006-12-13 17:43:45 +0000574 tprintf(", offset=%d, freq=%d, maxerror=%d, ",
575 tx.offset, tx.freq, tx.maxerror);
576 tprintf("esterror=%u, status=", tx.esterror);
577 printflags(adjtimex_status, tx.status, "STA_???");
578 tprintf(", constant=%d, precision=%u, ",
579 tx.constant, tx.precision);
580 tprintf("tolerance=%d, time=", tx.tolerance);
581 tprint_timeval32(tcp, &tx.time);
582 tprintf(", tick=%d, ppsfreq=%d, jitter=%d",
583 tx.tick, tx.ppsfreq, tx.jitter);
584 tprintf(", shift=%d, stabil=%d, jitcnt=%d",
585 tx.shift, tx.stabil, tx.jitcnt);
586 tprintf(", calcnt=%d, errcnt=%d, stbcnt=%d",
587 tx.calcnt, tx.errcnt, tx.stbcnt);
588 tprintf("}");
589 return 0;
590}
591#endif /* SUPPORTED_PERSONALITIES > 1 */
592
593static int
594tprint_timex(struct tcb *tcp, long addr)
Wichert Akkerman76baf7c1999-02-19 00:21:36 +0000595{
Dmitry V. Levin1a684d62006-12-13 17:42:32 +0000596 struct timex tx;
Wichert Akkerman76baf7c1999-02-19 00:21:36 +0000597
Dmitry V. Levin165b15d2006-12-13 17:43:45 +0000598#if SUPPORTED_PERSONALITIES > 1
599 if (personality_wordsize[current_personality] == 4)
600 return tprint_timex32(tcp, addr);
601#endif
602 if (umove(tcp, addr, &tx) < 0)
603 return -1;
604
605#if LINUX_VERSION_CODE < 66332
606 tprintf("{mode=%d, offset=%ld, frequency=%ld, ",
607 tx.mode, tx.offset, tx.frequency);
608 tprintf("maxerror=%ld, esterror=%lu, status=%u, ",
609 tx.maxerror, tx.esterror, tx.status);
610 tprintf("time_constant=%ld, precision=%lu, ",
611 tx.time_constant, tx.precision);
612 tprintf("tolerance=%ld, time=", tx.tolerance);
613 tprint_timeval(tcp, &tx.time);
614#else
615 tprintf("{modes=");
Dmitry V. Levin71d70892007-01-13 11:17:38 +0000616 printflags(adjtimex_modes, tx.modes, "ADJ_???");
Dmitry V. Levin165b15d2006-12-13 17:43:45 +0000617 tprintf(", offset=%ld, freq=%ld, maxerror=%ld, ",
618 tx.offset, tx.freq, tx.maxerror);
619 tprintf("esterror=%lu, status=", tx.esterror);
620 printflags(adjtimex_status, tx.status, "STA_???");
621 tprintf(", constant=%ld, precision=%lu, ",
622 tx.constant, tx.precision);
623 tprintf("tolerance=%ld, time=", tx.tolerance);
624 tprint_timeval(tcp, &tx.time);
625 tprintf(", tick=%ld, ppsfreq=%ld, jitter=%ld",
626 tx.tick, tx.ppsfreq, tx.jitter);
627 tprintf(", shift=%d, stabil=%ld, jitcnt=%ld",
628 tx.shift, tx.stabil, tx.jitcnt);
629 tprintf(", calcnt=%ld, errcnt=%ld, stbcnt=%ld",
630 tx.calcnt, tx.errcnt, tx.stbcnt);
631#endif
632 tprintf("}");
633 return 0;
634}
635
636int
637sys_adjtimex(struct tcb *tcp)
638{
Wichert Akkerman76baf7c1999-02-19 00:21:36 +0000639 if (exiting(tcp)) {
640 if (tcp->u_arg[0] == 0)
641 tprintf("NULL");
642 else if (syserror(tcp) || !verbose(tcp))
643 tprintf("%#lx", tcp->u_arg[0]);
Dmitry V. Levin165b15d2006-12-13 17:43:45 +0000644 else if (tprint_timex(tcp, tcp->u_arg[0]) < 0)
Wichert Akkerman76baf7c1999-02-19 00:21:36 +0000645 tprintf("{...}");
Dmitry V. Levin21a75342008-09-03 01:22:18 +0000646 if (syserror(tcp))
647 return 0;
Dmitry V. Levin1a684d62006-12-13 17:42:32 +0000648 tcp->auxstr = xlookup(adjtimex_state, tcp->u_rval);
649 if (tcp->auxstr)
650 return RVAL_STR;
Wichert Akkerman76baf7c1999-02-19 00:21:36 +0000651 }
652 return 0;
653}
Roland McGrath1e356792003-03-30 23:52:28 +0000654
Roland McGrathd9f816f2004-09-04 03:39:20 +0000655static const struct xlat clockflags[] = {
Roland McGrath1e356792003-03-30 23:52:28 +0000656 { TIMER_ABSTIME, "TIMER_ABSTIME" },
657 { 0, NULL }
658};
659
Roland McGrathd9f816f2004-09-04 03:39:20 +0000660static const struct xlat clocknames[] = {
Roland McGrath55a00f82004-08-31 08:26:39 +0000661#ifdef CLOCK_REALTIME
Roland McGrath54a4edd2004-08-31 06:52:45 +0000662 { CLOCK_REALTIME, "CLOCK_REALTIME" },
Roland McGrath55a00f82004-08-31 08:26:39 +0000663#endif
664#ifdef CLOCK_MONOTONIC
Roland McGrath54a4edd2004-08-31 06:52:45 +0000665 { CLOCK_MONOTONIC, "CLOCK_MONOTONIC" },
Roland McGrath55a00f82004-08-31 08:26:39 +0000666#endif
Dmitry V. Levincbaaf792010-09-17 09:19:49 +0000667#ifdef CLOCK_PROCESS_CPUTIME_ID
668 { CLOCK_PROCESS_CPUTIME_ID, "CLOCK_PROCESS_CPUTIME_ID" },
669#endif
670#ifdef CLOCK_THREAD_CPUTIME_ID
671 { CLOCK_THREAD_CPUTIME_ID, "CLOCK_THREAD_CPUTIME_ID" },
672#endif
673#ifdef CLOCK_MONOTONIC_RAW
674 { CLOCK_MONOTONIC_RAW, "CLOCK_MONOTONIC_RAW" },
675#endif
676#ifdef CLOCK_REALTIME_COARSE
677 { CLOCK_REALTIME_COARSE, "CLOCK_REALTIME_COARSE" },
678#endif
679#ifdef CLOCK_MONOTONIC_COARSE
680 { CLOCK_MONOTONIC_COARSE, "CLOCK_MONOTONIC_COARSE" },
681#endif
682 { 0, NULL }
Roland McGrath54a4edd2004-08-31 06:52:45 +0000683};
684
Roland McGrath1e356792003-03-30 23:52:28 +0000685int
Denys Vlasenko12014262011-05-30 14:00:14 +0200686sys_clock_settime(struct tcb *tcp)
Roland McGrath1e356792003-03-30 23:52:28 +0000687{
688 if (entering(tcp)) {
Roland McGrath54a4edd2004-08-31 06:52:45 +0000689 printxval(clocknames, tcp->u_arg[0], "CLOCK_???");
690 tprintf(", ");
Roland McGrath1e356792003-03-30 23:52:28 +0000691 printtv(tcp, tcp->u_arg[1]);
692 }
693 return 0;
694}
695
696int
Denys Vlasenko12014262011-05-30 14:00:14 +0200697sys_clock_gettime(struct tcb *tcp)
Roland McGrath1e356792003-03-30 23:52:28 +0000698{
699 if (entering(tcp)) {
Roland McGrath54a4edd2004-08-31 06:52:45 +0000700 printxval(clocknames, tcp->u_arg[0], "CLOCK_???");
701 tprintf(", ");
Roland McGrath1e356792003-03-30 23:52:28 +0000702 } else {
703 if (syserror(tcp))
704 tprintf("%#lx", tcp->u_arg[1]);
705 else
706 printtv(tcp, tcp->u_arg[1]);
707 }
708 return 0;
709}
710
711int
Denys Vlasenko12014262011-05-30 14:00:14 +0200712sys_clock_nanosleep(struct tcb *tcp)
Roland McGrath1e356792003-03-30 23:52:28 +0000713{
714 if (entering(tcp)) {
Roland McGrath54a4edd2004-08-31 06:52:45 +0000715 printxval(clocknames, tcp->u_arg[0], "CLOCK_???");
716 tprintf(", ");
Roland McGrathb2dee132005-06-01 19:02:36 +0000717 printflags(clockflags, tcp->u_arg[1], "TIMER_???");
Roland McGrath1e356792003-03-30 23:52:28 +0000718 tprintf(", ");
719 printtv(tcp, tcp->u_arg[2]);
720 tprintf(", ");
721 } else {
722 if (syserror(tcp))
723 tprintf("%#lx", tcp->u_arg[3]);
724 else
725 printtv(tcp, tcp->u_arg[3]);
726 }
727 return 0;
728}
729
730#ifndef SIGEV_THREAD_ID
731# define SIGEV_THREAD_ID 4
732#endif
Roland McGrathd9f816f2004-09-04 03:39:20 +0000733static const struct xlat sigev_value[] = {
Roland McGrath1e356792003-03-30 23:52:28 +0000734 { SIGEV_SIGNAL+1, "SIGEV_SIGNAL" },
735 { SIGEV_NONE+1, "SIGEV_NONE" },
736 { SIGEV_THREAD+1, "SIGEV_THREAD" },
737 { SIGEV_THREAD_ID+1, "SIGEV_THREAD_ID" },
738 { 0, NULL }
739};
740
Dmitry V. Levind3cb3922006-12-13 17:45:02 +0000741#if SUPPORTED_PERSONALITIES > 1
742static void
743printsigevent32(struct tcb *tcp, long arg)
744{
Denys Vlasenko1d632462009-04-14 12:51:00 +0000745 struct {
Dmitry V. Levind3cb3922006-12-13 17:45:02 +0000746 int sigev_value;
747 int sigev_signo;
748 int sigev_notify;
749
Denys Vlasenko1d632462009-04-14 12:51:00 +0000750 union {
Dmitry V. Levind3cb3922006-12-13 17:45:02 +0000751 int tid;
Denys Vlasenko1d632462009-04-14 12:51:00 +0000752 struct {
Dmitry V. Levind3cb3922006-12-13 17:45:02 +0000753 int function, attribute;
754 } thread;
755 } un;
756 } sev;
757
758 if (umove(tcp, arg, &sev) < 0)
759 tprintf("{...}");
Denys Vlasenko1d632462009-04-14 12:51:00 +0000760 else {
Dmitry V. Levind3cb3922006-12-13 17:45:02 +0000761 tprintf("{%#x, ", sev.sigev_value);
762 if (sev.sigev_notify == SIGEV_SIGNAL)
763 tprintf("%s, ", signame(sev.sigev_signo));
764 else
765 tprintf("%u, ", sev.sigev_signo);
766 printxval(sigev_value, sev.sigev_notify + 1, "SIGEV_???");
767 tprintf(", ");
768 if (sev.sigev_notify == SIGEV_THREAD_ID)
769 tprintf("{%d}", sev.un.tid);
770 else if (sev.sigev_notify == SIGEV_THREAD)
771 tprintf("{%#x, %#x}",
772 sev.un.thread.function,
773 sev.un.thread.attribute);
774 else
775 tprintf("{...}");
776 tprintf("}");
777 }
778}
779#endif
780
Roland McGrath1e356792003-03-30 23:52:28 +0000781void
Dmitry V. Levind3cb3922006-12-13 17:45:02 +0000782printsigevent(struct tcb *tcp, long arg)
Roland McGrath1e356792003-03-30 23:52:28 +0000783{
784 struct sigevent sev;
Dmitry V. Levind3cb3922006-12-13 17:45:02 +0000785
786#if SUPPORTED_PERSONALITIES > 1
787 if (personality_wordsize[current_personality] == 4)
788 {
789 printsigevent32(tcp, arg);
790 return;
791 }
792#endif
Roland McGrath1e356792003-03-30 23:52:28 +0000793 if (umove (tcp, arg, &sev) < 0)
794 tprintf("{...}");
795 else {
Roland McGrath675d4a62004-09-11 08:12:45 +0000796 tprintf("{%p, ", sev.sigev_value.sival_ptr);
797 if (sev.sigev_notify == SIGEV_SIGNAL)
798 tprintf("%s, ", signame(sev.sigev_signo));
799 else
800 tprintf("%u, ", sev.sigev_signo);
Roland McGrath1e356792003-03-30 23:52:28 +0000801 printxval(sigev_value, sev.sigev_notify+1, "SIGEV_???");
802 tprintf(", ");
803 if (sev.sigev_notify == SIGEV_THREAD_ID)
804 /* _pad[0] is the _tid field which might not be
805 present in the userlevel definition of the
806 struct. */
807 tprintf("{%d}", sev._sigev_un._pad[0]);
Roland McGrathd4c85eb2004-04-16 21:48:44 +0000808 else if (sev.sigev_notify == SIGEV_THREAD)
809 tprintf("{%p, %p}", sev.sigev_notify_function,
810 sev.sigev_notify_attributes);
Roland McGrath1e356792003-03-30 23:52:28 +0000811 else
812 tprintf("{...}");
813 tprintf("}");
814 }
815}
816
817int
Denys Vlasenko12014262011-05-30 14:00:14 +0200818sys_timer_create(struct tcb *tcp)
Roland McGrath1e356792003-03-30 23:52:28 +0000819{
820 if (entering(tcp)) {
Roland McGrath675d4a62004-09-11 08:12:45 +0000821 printxval(clocknames, tcp->u_arg[0], "CLOCK_???");
822 tprintf(", ");
Roland McGrath1e356792003-03-30 23:52:28 +0000823 printsigevent(tcp, tcp->u_arg[1]);
824 tprintf(", ");
825 } else {
Dmitry V. Levinac518d12006-12-13 17:03:02 +0000826 void *p;
827
828 if (syserror(tcp) || umove(tcp, tcp->u_arg[2], &p) < 0)
Roland McGrath1e356792003-03-30 23:52:28 +0000829 tprintf("%#lx", tcp->u_arg[2]);
Dmitry V. Levinac518d12006-12-13 17:03:02 +0000830 else
Roland McGrath1e356792003-03-30 23:52:28 +0000831 tprintf("{%p}", p);
Roland McGrath1e356792003-03-30 23:52:28 +0000832 }
833 return 0;
834}
835
836int
Denys Vlasenko12014262011-05-30 14:00:14 +0200837sys_timer_settime(struct tcb *tcp)
Roland McGrath1e356792003-03-30 23:52:28 +0000838{
839 if (entering(tcp)) {
840 tprintf("%#lx, ", tcp->u_arg[0]);
Roland McGrathb2dee132005-06-01 19:02:36 +0000841 printflags(clockflags, tcp->u_arg[1], "TIMER_???");
Roland McGrath1e356792003-03-30 23:52:28 +0000842 tprintf(", ");
843 printitv(tcp, tcp->u_arg[2]);
844 tprintf(", ");
845 } else {
846 if (syserror(tcp))
847 tprintf("%#lx", tcp->u_arg[3]);
848 else
849 printitv(tcp, tcp->u_arg[3]);
850 }
851 return 0;
852}
853
854int
Denys Vlasenko12014262011-05-30 14:00:14 +0200855sys_timer_gettime(struct tcb *tcp)
Roland McGrath1e356792003-03-30 23:52:28 +0000856{
857 if (entering(tcp)) {
858 tprintf("%#lx, ", tcp->u_arg[0]);
859 } else {
860 if (syserror(tcp))
861 tprintf("%#lx", tcp->u_arg[1]);
862 else
863 printitv(tcp, tcp->u_arg[1]);
864 }
865 return 0;
866}
Roland McGrathd83c50b2004-10-06 22:27:43 +0000867
868static void
Denys Vlasenko12014262011-05-30 14:00:14 +0200869print_rtc(struct tcb *tcp, const struct rtc_time *rt)
Roland McGrathd83c50b2004-10-06 22:27:43 +0000870{
871 tprintf("{tm_sec=%d, tm_min=%d, tm_hour=%d, "
872 "tm_mday=%d, tm_mon=%d, tm_year=%d, ",
873 rt->tm_sec, rt->tm_min, rt->tm_hour,
874 rt->tm_mday, rt->tm_mon, rt->tm_year);
875 if (!abbrev(tcp))
876 tprintf("tm_wday=%d, tm_yday=%d, tm_isdst=%d}",
877 rt->tm_wday, rt->tm_yday, rt->tm_isdst);
878 else
879 tprintf("...}");
880}
881
882int
Denys Vlasenko12014262011-05-30 14:00:14 +0200883rtc_ioctl(struct tcb *tcp, long code, long arg)
Roland McGrathd83c50b2004-10-06 22:27:43 +0000884{
885 switch (code) {
886 case RTC_ALM_SET:
887 case RTC_SET_TIME:
888 if (entering(tcp)) {
889 struct rtc_time rt;
890 if (umove(tcp, arg, &rt) < 0)
891 tprintf(", %#lx", arg);
892 else {
893 tprintf(", ");
894 print_rtc(tcp, &rt);
895 }
896 }
897 break;
898 case RTC_ALM_READ:
899 case RTC_RD_TIME:
900 if (exiting(tcp)) {
901 struct rtc_time rt;
902 if (syserror(tcp) || umove(tcp, arg, &rt) < 0)
903 tprintf(", %#lx", arg);
904 else {
905 tprintf(", ");
906 print_rtc(tcp, &rt);
907 }
908 }
909 break;
910 case RTC_IRQP_SET:
911 case RTC_EPOCH_SET:
912 if (entering(tcp))
913 tprintf(", %lu", arg);
914 break;
915 case RTC_IRQP_READ:
916 case RTC_EPOCH_READ:
917 if (exiting(tcp))
918 tprintf(", %lu", arg);
919 break;
920 case RTC_WKALM_SET:
921 if (entering(tcp)) {
922 struct rtc_wkalrm wk;
923 if (umove(tcp, arg, &wk) < 0)
924 tprintf(", %#lx", arg);
925 else {
926 tprintf(", {enabled=%d, pending=%d, ",
927 wk.enabled, wk.pending);
928 print_rtc(tcp, &wk.time);
929 tprintf("}");
930 }
931 }
932 break;
933 case RTC_WKALM_RD:
934 if (exiting(tcp)) {
935 struct rtc_wkalrm wk;
936 if (syserror(tcp) || umove(tcp, arg, &wk) < 0)
937 tprintf(", %#lx", arg);
938 else {
939 tprintf(", {enabled=%d, pending=%d, ",
940 wk.enabled, wk.pending);
941 print_rtc(tcp, &wk.time);
942 tprintf("}");
943 }
944 }
945 break;
946 default:
947 if (entering(tcp))
948 tprintf(", %#lx", arg);
949 break;
950 }
951 return 1;
952}
Roland McGrathe4662342007-08-02 01:25:34 +0000953
954#ifndef TFD_TIMER_ABSTIME
955#define TFD_TIMER_ABSTIME (1 << 0)
956#endif
957
958static const struct xlat timerfdflags[] = {
959 { TFD_TIMER_ABSTIME, "TFD_TIMER_ABSTIME" },
960 { 0, NULL }
961};
962
963int
Denys Vlasenko12014262011-05-30 14:00:14 +0200964sys_timerfd(struct tcb *tcp)
Roland McGrathe4662342007-08-02 01:25:34 +0000965{
966 if (entering(tcp)) {
967 /* It does not matter that the kernel uses itimerspec. */
968 tprintf("%ld, ", tcp->u_arg[0]);
969 printxval(clocknames, tcp->u_arg[1], "CLOCK_???");
970 tprintf(", ");
971 printflags(timerfdflags, tcp->u_arg[2], "TFD_???");
972 tprintf(", ");
973 printitv(tcp, tcp->u_arg[3]);
974 }
975 return 0;
976}
Roland McGrathde328e62008-05-20 04:56:13 +0000977
978int
979sys_timerfd_create(struct tcb *tcp)
980{
981 if (entering(tcp)) {
982 printxval(clocknames, tcp->u_arg[0], "CLOCK_???");
983 tprintf(", ");
984 printflags(timerfdflags, tcp->u_arg[1], "TFD_???");
985 }
986 return 0;
987}
988
989int
990sys_timerfd_settime(struct tcb *tcp)
991{
992 if (entering(tcp)) {
Dmitry V. Levin31382132011-03-04 05:08:02 +0300993 printfd(tcp, tcp->u_arg[0]);
994 tprintf(", ");
Roland McGrathde328e62008-05-20 04:56:13 +0000995 printflags(timerfdflags, tcp->u_arg[1], "TFD_???");
996 tprintf(", ");
997 printitv(tcp, tcp->u_arg[2]);
998 tprintf(", ");
999 printitv(tcp, tcp->u_arg[3]);
1000 }
1001 return 0;
1002}
1003
1004int
1005sys_timerfd_gettime(struct tcb *tcp)
1006{
1007 if (entering(tcp)) {
Dmitry V. Levin31382132011-03-04 05:08:02 +03001008 printfd(tcp, tcp->u_arg[0]);
Roland McGrathde328e62008-05-20 04:56:13 +00001009 tprintf(", ");
1010 printitv(tcp, tcp->u_arg[1]);
1011 }
1012 return 0;
1013}
1014
Wichert Akkerman76baf7c1999-02-19 00:21:36 +00001015#endif /* LINUX */