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>
7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions
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.
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.
35 #include <linux/version.h>
36 #include <linux/timex.h>
48 else if (!verbose(tcp))
49 tprintf("%#lx", addr);
50 else if (umove(tcp, addr, &tv) < 0)
53 tprintf("{%lu, %lu}", (long) tv.tv_sec, (long) tv.tv_usec);
62 printnum(tcp, tcp->u_arg[0], "%ld");
73 printnum(tcp, tcp->u_arg[0], "%ld");
85 tcp->u_arg[0], tcp->u_arg[1]);
88 printtv(tcp, tcp->u_arg[0]);
91 printtv(tcp, tcp->u_arg[1]);
102 printtv(tcp, tcp->u_arg[0]);
105 printtv(tcp, tcp->u_arg[1]);
116 printtv(tcp, tcp->u_arg[0]);
120 tprintf("%#lx", tcp->u_arg[1]);
122 printtv(tcp, tcp->u_arg[1]);
127 static struct xlat which[] = {
128 { ITIMER_REAL, "ITIMER_REAL" },
129 { ITIMER_VIRTUAL,"ITIMER_VIRTUAL"},
130 { ITIMER_PROF, "ITIMER_PROF" },
139 struct itimerval itv;
143 else if (!verbose(tcp))
144 tprintf("%#lx", addr);
145 else if (umove(tcp, addr, &itv) < 0)
148 tprintf("{it_interval={%lu, %lu}, it_value={%lu, %lu}}",
149 (long) itv.it_interval.tv_sec, (long) itv.it_interval.tv_usec,
150 (long) itv.it_value.tv_sec, (long) itv.it_value.tv_usec);
159 printxval(which, tcp->u_arg[0], "ITIMER_???");
163 tprintf("%#lx", tcp->u_arg[1]);
165 printitv(tcp, tcp->u_arg[1]);
175 printxval(which, tcp->u_arg[0], "ITIMER_???");
177 printitv(tcp, tcp->u_arg[1]);
181 tprintf("%#lx", tcp->u_arg[2]);
183 printitv(tcp, tcp->u_arg[2]);
197 if (tcp->u_arg[0] == 0)
199 else if (syserror(tcp) || !verbose(tcp))
200 tprintf("%#lx", tcp->u_arg[0]);
201 else if (umove(tcp, tcp->u_arg[0], &txc) < 0)
204 #if LINUX_VERSION_CODE < 66332
205 tprintf("{mode=%d, offset=%ld, frequency=%ld, ",
206 txc.mode, txc.offset, txc.frequency);
207 tprintf("maxerror=%ld, esterror=%lu, status=%u, ",
208 txc.maxerror, txc.esterror, txc.status);
209 tprintf("time_constant=%ld, precision=%lu, ",
210 txc.time_constant, txc.precision);
211 tprintf("tolerance=%ld, time={%lu, %lu}}",
212 txc.tolerance, (long) txc.time.tv_sec,
213 (long) txc.time.tv_usec);
215 tprintf("{modes=%d, offset=%ld, freq=%ld, ",
216 txc.modes, txc.offset, txc.freq);
217 tprintf("maxerror=%ld, esterror=%lu, status=%u, ",
218 txc.maxerror, txc.esterror, txc.status);
219 tprintf("constant=%ld, precision=%lu, ",
220 txc.constant, txc.precision);
221 tprintf("tolerance=%ld, time={%lu, %lu}}",
222 txc.tolerance, (long) txc.time.tv_sec,
223 (long) txc.time.tv_usec);
224 /* there's a bunch of other stuff, but it's not
225 * worth the time or the trouble to include */