+ if (entering(tcp)) {
+ printxval(which, tcp->u_arg[0], "ITIMER_???");
+ tprintf(", ");
+ printitv_bitness(tcp, tcp->u_arg[1], BITNESS_32);
+ tprintf(", ");
+ } else {
+ if (syserror(tcp))
+ tprintf("%#lx", tcp->u_arg[2]);
+ else
+ printitv_bitness(tcp, tcp->u_arg[2], BITNESS_32);
+ }
+ return 0;
+}
+#endif
+
+#ifdef LINUX
+
+static const struct xlat adjtimex_modes[] = {
+ { 0, "0" },
+#ifdef ADJ_OFFSET
+ { ADJ_OFFSET, "ADJ_OFFSET" },
+#endif
+#ifdef ADJ_FREQUENCY
+ { ADJ_FREQUENCY, "ADJ_FREQUENCY" },
+#endif
+#ifdef ADJ_MAXERROR
+ { ADJ_MAXERROR, "ADJ_MAXERROR" },
+#endif
+#ifdef ADJ_ESTERROR
+ { ADJ_ESTERROR, "ADJ_ESTERROR" },
+#endif
+#ifdef ADJ_STATUS
+ { ADJ_STATUS, "ADJ_STATUS" },
+#endif
+#ifdef ADJ_TIMECONST
+ { ADJ_TIMECONST, "ADJ_TIMECONST" },
+#endif
+#ifdef ADJ_TICK
+ { ADJ_TICK, "ADJ_TICK" },
+#endif
+#ifdef ADJ_OFFSET_SINGLESHOT
+ { ADJ_OFFSET_SINGLESHOT, "ADJ_OFFSET_SINGLESHOT" },
+#endif
+ { 0, NULL }
+};
+
+static const struct xlat adjtimex_status[] = {
+#ifdef STA_PLL
+ { STA_PLL, "STA_PLL" },
+#endif
+#ifdef STA_PPSFREQ
+ { STA_PPSFREQ, "STA_PPSFREQ" },
+#endif
+#ifdef STA_PPSTIME
+ { STA_PPSTIME, "STA_PPSTIME" },
+#endif
+#ifdef STA_FLL
+ { STA_FLL, "STA_FLL" },
+#endif
+#ifdef STA_INS
+ { STA_INS, "STA_INS" },
+#endif
+#ifdef STA_DEL
+ { STA_DEL, "STA_DEL" },
+#endif
+#ifdef STA_UNSYNC
+ { STA_UNSYNC, "STA_UNSYNC" },
+#endif
+#ifdef STA_FREQHOLD
+ { STA_FREQHOLD, "STA_FREQHOLD" },
+#endif
+#ifdef STA_PPSSIGNAL
+ { STA_PPSSIGNAL, "STA_PPSSIGNAL" },
+#endif
+#ifdef STA_PPSJITTER
+ { STA_PPSJITTER, "STA_PPSJITTER" },
+#endif
+#ifdef STA_PPSWANDER
+ { STA_PPSWANDER, "STA_PPSWANDER" },
+#endif
+#ifdef STA_PPSERROR
+ { STA_PPSERROR, "STA_PPSERROR" },
+#endif
+#ifdef STA_CLOCKERR
+ { STA_CLOCKERR, "STA_CLOCKERR" },
+#endif
+ { 0, NULL }
+};
+
+static const struct xlat adjtimex_state[] = {
+#ifdef TIME_OK
+ { TIME_OK, "TIME_OK" },
+#endif
+#ifdef TIME_INS
+ { TIME_INS, "TIME_INS" },
+#endif
+#ifdef TIME_DEL
+ { TIME_DEL, "TIME_DEL" },
+#endif
+#ifdef TIME_OOP
+ { TIME_OOP, "TIME_OOP" },
+#endif
+#ifdef TIME_WAIT
+ { TIME_WAIT, "TIME_WAIT" },
+#endif
+#ifdef TIME_ERROR
+ { TIME_ERROR, "TIME_ERROR" },
+#endif
+ { 0, NULL }
+};
+
+#if SUPPORTED_PERSONALITIES > 1
+static int
+tprint_timex32(struct tcb *tcp, long addr)
+{
+ struct {
+ unsigned int modes;
+ int offset;
+ int freq;
+ int maxerror;
+ int esterror;
+ int status;
+ int constant;
+ int precision;
+ int tolerance;
+ struct timeval32 time;
+ int tick;
+ int ppsfreq;
+ int jitter;
+ int shift;
+ int stabil;
+ int jitcnt;
+ int calcnt;
+ int errcnt;
+ int stbcnt;
+ } tx;
+
+ if (umove(tcp, addr, &tx) < 0)
+ return -1;
+
+ tprintf("{modes=");
+ printflags(adjtimex_modes, tx.modes, "ADJ_???");
+ tprintf(", offset=%d, freq=%d, maxerror=%d, ",
+ tx.offset, tx.freq, tx.maxerror);
+ tprintf("esterror=%u, status=", tx.esterror);
+ printflags(adjtimex_status, tx.status, "STA_???");
+ tprintf(", constant=%d, precision=%u, ",
+ tx.constant, tx.precision);
+ tprintf("tolerance=%d, time=", tx.tolerance);
+ tprint_timeval32(tcp, &tx.time);
+ tprintf(", tick=%d, ppsfreq=%d, jitter=%d",
+ tx.tick, tx.ppsfreq, tx.jitter);
+ tprintf(", shift=%d, stabil=%d, jitcnt=%d",
+ tx.shift, tx.stabil, tx.jitcnt);
+ tprintf(", calcnt=%d, errcnt=%d, stbcnt=%d",
+ tx.calcnt, tx.errcnt, tx.stbcnt);
+ tprintf("}");
+ return 0;
+}
+#endif /* SUPPORTED_PERSONALITIES > 1 */