Wichert Akkerman | 76baf7c | 1999-02-19 00:21:36 +0000 | [diff] [blame] | 1 | /* |
| 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. |
Wichert Akkerman | 76baf7c | 1999-02-19 00:21:36 +0000 | [diff] [blame] | 28 | */ |
| 29 | |
| 30 | #include "defs.h" |
Wichert Akkerman | 76baf7c | 1999-02-19 00:21:36 +0000 | [diff] [blame] | 31 | #include <linux/version.h> |
Wichert Akkerman | d856b99 | 2000-10-13 12:47:12 +0000 | [diff] [blame] | 32 | #include <sys/timex.h> |
Roland McGrath | d83c50b | 2004-10-06 22:27:43 +0000 | [diff] [blame] | 33 | #include <linux/ioctl.h> |
| 34 | #include <linux/rtc.h> |
Roland McGrath | 6afc565 | 2007-07-24 01:57:11 +0000 | [diff] [blame] | 35 | |
| 36 | #ifndef UTIME_NOW |
| 37 | #define UTIME_NOW ((1l << 30) - 1l) |
| 38 | #endif |
| 39 | #ifndef UTIME_OMIT |
| 40 | #define UTIME_OMIT ((1l << 30) - 2l) |
| 41 | #endif |
Wichert Akkerman | 76baf7c | 1999-02-19 00:21:36 +0000 | [diff] [blame] | 42 | |
Dmitry V. Levin | a7945a3 | 2006-12-13 17:10:11 +0000 | [diff] [blame] | 43 | struct timeval32 |
Wichert Akkerman | 76baf7c | 1999-02-19 00:21:36 +0000 | [diff] [blame] | 44 | { |
Dmitry V. Levin | a7945a3 | 2006-12-13 17:10:11 +0000 | [diff] [blame] | 45 | u_int32_t tv_sec, tv_usec; |
| 46 | }; |
Wichert Akkerman | 76baf7c | 1999-02-19 00:21:36 +0000 | [diff] [blame] | 47 | |
Dmitry V. Levin | 1cad25d | 2006-12-13 17:14:36 +0000 | [diff] [blame] | 48 | static void |
| 49 | tprint_timeval32(struct tcb *tcp, const struct timeval32 *tv) |
| 50 | { |
| 51 | tprintf("{%u, %u}", tv->tv_sec, tv->tv_usec); |
| 52 | } |
| 53 | |
| 54 | static void |
| 55 | tprint_timeval(struct tcb *tcp, const struct timeval *tv) |
| 56 | { |
| 57 | tprintf("{%lu, %lu}", |
| 58 | (unsigned long) tv->tv_sec, (unsigned long) tv->tv_usec); |
| 59 | } |
| 60 | |
Dmitry V. Levin | a7945a3 | 2006-12-13 17:10:11 +0000 | [diff] [blame] | 61 | void |
Roland McGrath | 6afc565 | 2007-07-24 01:57:11 +0000 | [diff] [blame] | 62 | printtv_bitness(struct tcb *tcp, long addr, enum bitness_t bitness, int special) |
Dmitry V. Levin | a7945a3 | 2006-12-13 17:10:11 +0000 | [diff] [blame] | 63 | { |
Denys Vlasenko | a1d541e | 2012-01-20 11:04:04 +0100 | [diff] [blame] | 64 | char buf[TIMEVAL_TEXT_BUFSIZE]; |
| 65 | sprinttv(buf, tcp, addr, bitness, special); |
| 66 | tprints(buf); |
Dmitry V. Levin | a7945a3 | 2006-12-13 17:10:11 +0000 | [diff] [blame] | 67 | } |
Wichert Akkerman | 221f54f | 1999-11-18 17:26:45 +0000 | [diff] [blame] | 68 | |
Denys Vlasenko | 2fb4db3 | 2011-08-31 12:26:03 +0200 | [diff] [blame] | 69 | char * |
Denys Vlasenko | a1d541e | 2012-01-20 11:04:04 +0100 | [diff] [blame] | 70 | sprinttv(char *buf, struct tcb *tcp, long addr, enum bitness_t bitness, int special) |
Wichert Akkerman | f5eeabb | 1999-11-18 17:09:47 +0000 | [diff] [blame] | 71 | { |
Denys Vlasenko | 2fb4db3 | 2011-08-31 12:26:03 +0200 | [diff] [blame] | 72 | int rc; |
| 73 | |
Dmitry V. Levin | a7945a3 | 2006-12-13 17:10:11 +0000 | [diff] [blame] | 74 | if (addr == 0) |
Denys Vlasenko | 2fb4db3 | 2011-08-31 12:26:03 +0200 | [diff] [blame] | 75 | return stpcpy(buf, "NULL"); |
Wichert Akkerman | f5eeabb | 1999-11-18 17:09:47 +0000 | [diff] [blame] | 76 | |
Denys Vlasenko | b9c7ae6 | 2011-09-01 11:40:40 +0200 | [diff] [blame] | 77 | if (!verbose(tcp)) |
| 78 | return buf + sprintf(buf, "%#lx", addr); |
Denys Vlasenko | 2fb4db3 | 2011-08-31 12:26:03 +0200 | [diff] [blame] | 79 | |
| 80 | if (bitness == BITNESS_32 |
Denys Vlasenko | 8470374 | 2012-02-25 02:38:52 +0100 | [diff] [blame] | 81 | #if SUPPORTED_PERSONALITIES > 1 |
Denys Vlasenko | 9fd4f96 | 2012-03-19 09:36:42 +0100 | [diff] [blame] | 82 | || current_wordsize == 4 |
Denys Vlasenko | 2fb4db3 | 2011-08-31 12:26:03 +0200 | [diff] [blame] | 83 | #endif |
| 84 | ) |
| 85 | { |
| 86 | struct timeval32 tv; |
| 87 | |
| 88 | rc = umove(tcp, addr, &tv); |
Denys Vlasenko | a1d541e | 2012-01-20 11:04:04 +0100 | [diff] [blame] | 89 | if (rc >= 0) { |
| 90 | if (special && tv.tv_sec == 0) { |
| 91 | if (tv.tv_usec == UTIME_NOW) |
| 92 | return stpcpy(buf, "UTIME_NOW"); |
| 93 | if (tv.tv_usec == UTIME_OMIT) |
| 94 | return stpcpy(buf, "UTIME_OMIT"); |
| 95 | } |
Denys Vlasenko | b9c7ae6 | 2011-09-01 11:40:40 +0200 | [diff] [blame] | 96 | return buf + sprintf(buf, "{%u, %u}", |
Denys Vlasenko | 2fb4db3 | 2011-08-31 12:26:03 +0200 | [diff] [blame] | 97 | tv.tv_sec, tv.tv_usec); |
Denys Vlasenko | a1d541e | 2012-01-20 11:04:04 +0100 | [diff] [blame] | 98 | } |
Denys Vlasenko | 2fb4db3 | 2011-08-31 12:26:03 +0200 | [diff] [blame] | 99 | } else { |
| 100 | struct timeval tv; |
| 101 | |
| 102 | rc = umove(tcp, addr, &tv); |
Denys Vlasenko | a1d541e | 2012-01-20 11:04:04 +0100 | [diff] [blame] | 103 | if (rc >= 0) { |
| 104 | if (special && tv.tv_sec == 0) { |
| 105 | if (tv.tv_usec == UTIME_NOW) |
| 106 | return stpcpy(buf, "UTIME_NOW"); |
| 107 | if (tv.tv_usec == UTIME_OMIT) |
| 108 | return stpcpy(buf, "UTIME_OMIT"); |
| 109 | } |
Denys Vlasenko | b9c7ae6 | 2011-09-01 11:40:40 +0200 | [diff] [blame] | 110 | return buf + sprintf(buf, "{%lu, %lu}", |
Denys Vlasenko | 2fb4db3 | 2011-08-31 12:26:03 +0200 | [diff] [blame] | 111 | (unsigned long) tv.tv_sec, |
| 112 | (unsigned long) tv.tv_usec); |
Denys Vlasenko | a1d541e | 2012-01-20 11:04:04 +0100 | [diff] [blame] | 113 | } |
Denys Vlasenko | 2fb4db3 | 2011-08-31 12:26:03 +0200 | [diff] [blame] | 114 | } |
Denys Vlasenko | 2fb4db3 | 2011-08-31 12:26:03 +0200 | [diff] [blame] | 115 | |
Denys Vlasenko | b9c7ae6 | 2011-09-01 11:40:40 +0200 | [diff] [blame] | 116 | return stpcpy(buf, "{...}"); |
Dmitry V. Levin | a7945a3 | 2006-12-13 17:10:11 +0000 | [diff] [blame] | 117 | } |
Wichert Akkerman | f5eeabb | 1999-11-18 17:09:47 +0000 | [diff] [blame] | 118 | |
Denys Vlasenko | a1d541e | 2012-01-20 11:04:04 +0100 | [diff] [blame] | 119 | void |
| 120 | print_timespec(struct tcb *tcp, long addr) |
Roland McGrath | 6bc09da | 2007-11-01 21:50:54 +0000 | [diff] [blame] | 121 | { |
Denys Vlasenko | a1d541e | 2012-01-20 11:04:04 +0100 | [diff] [blame] | 122 | char buf[TIMESPEC_TEXT_BUFSIZE]; |
| 123 | sprint_timespec(buf, tcp, addr); |
| 124 | tprints(buf); |
Roland McGrath | 6bc09da | 2007-11-01 21:50:54 +0000 | [diff] [blame] | 125 | } |
| 126 | |
Denys Vlasenko | a1d541e | 2012-01-20 11:04:04 +0100 | [diff] [blame] | 127 | void |
| 128 | sprint_timespec(char *buf, struct tcb *tcp, long addr) |
Roland McGrath | 6bc09da | 2007-11-01 21:50:54 +0000 | [diff] [blame] | 129 | { |
| 130 | if (addr == 0) |
| 131 | strcpy(buf, "NULL"); |
| 132 | else if (!verbose(tcp)) |
| 133 | sprintf(buf, "%#lx", addr); |
| 134 | else { |
Denys Vlasenko | 1d63246 | 2009-04-14 12:51:00 +0000 | [diff] [blame] | 135 | int rc; |
Roland McGrath | 6bc09da | 2007-11-01 21:50:54 +0000 | [diff] [blame] | 136 | |
Denys Vlasenko | 8470374 | 2012-02-25 02:38:52 +0100 | [diff] [blame] | 137 | #if SUPPORTED_PERSONALITIES > 1 |
Denys Vlasenko | 9fd4f96 | 2012-03-19 09:36:42 +0100 | [diff] [blame] | 138 | if (current_wordsize == 4) { |
Roland McGrath | 6bc09da | 2007-11-01 21:50:54 +0000 | [diff] [blame] | 139 | struct timeval32 tv; |
| 140 | |
Denys Vlasenko | 5d64581 | 2011-08-20 12:48:18 +0200 | [diff] [blame] | 141 | rc = umove(tcp, addr, &tv); |
| 142 | if (rc >= 0) |
Roland McGrath | 6bc09da | 2007-11-01 21:50:54 +0000 | [diff] [blame] | 143 | sprintf(buf, "{%u, %u}", |
| 144 | tv.tv_sec, tv.tv_usec); |
| 145 | } else |
Roland McGrath | 6bc09da | 2007-11-01 21:50:54 +0000 | [diff] [blame] | 146 | #endif |
Denys Vlasenko | 1d63246 | 2009-04-14 12:51:00 +0000 | [diff] [blame] | 147 | { |
Roland McGrath | 6bc09da | 2007-11-01 21:50:54 +0000 | [diff] [blame] | 148 | struct timespec ts; |
| 149 | |
Denys Vlasenko | 5d64581 | 2011-08-20 12:48:18 +0200 | [diff] [blame] | 150 | rc = umove(tcp, addr, &ts); |
| 151 | if (rc >= 0) |
Roland McGrath | 6bc09da | 2007-11-01 21:50:54 +0000 | [diff] [blame] | 152 | sprintf(buf, "{%lu, %lu}", |
| 153 | (unsigned long) ts.tv_sec, |
| 154 | (unsigned long) ts.tv_nsec); |
Roland McGrath | 6bc09da | 2007-11-01 21:50:54 +0000 | [diff] [blame] | 155 | } |
Roland McGrath | 6bc09da | 2007-11-01 21:50:54 +0000 | [diff] [blame] | 156 | if (rc < 0) |
| 157 | strcpy(buf, "{...}"); |
| 158 | } |
| 159 | } |
| 160 | |
Wichert Akkerman | 76baf7c | 1999-02-19 00:21:36 +0000 | [diff] [blame] | 161 | int |
Denys Vlasenko | 1201426 | 2011-05-30 14:00:14 +0200 | [diff] [blame] | 162 | sys_time(struct tcb *tcp) |
Wichert Akkerman | 76baf7c | 1999-02-19 00:21:36 +0000 | [diff] [blame] | 163 | { |
| 164 | if (exiting(tcp)) { |
Wichert Akkerman | 76baf7c | 1999-02-19 00:21:36 +0000 | [diff] [blame] | 165 | printnum(tcp, tcp->u_arg[0], "%ld"); |
Wichert Akkerman | 76baf7c | 1999-02-19 00:21:36 +0000 | [diff] [blame] | 166 | } |
| 167 | return 0; |
| 168 | } |
| 169 | |
| 170 | int |
Denys Vlasenko | 1201426 | 2011-05-30 14:00:14 +0200 | [diff] [blame] | 171 | sys_stime(struct tcb *tcp) |
Wichert Akkerman | 76baf7c | 1999-02-19 00:21:36 +0000 | [diff] [blame] | 172 | { |
| 173 | if (exiting(tcp)) { |
| 174 | printnum(tcp, tcp->u_arg[0], "%ld"); |
| 175 | } |
| 176 | return 0; |
| 177 | } |
| 178 | |
| 179 | int |
Denys Vlasenko | 1201426 | 2011-05-30 14:00:14 +0200 | [diff] [blame] | 180 | sys_gettimeofday(struct tcb *tcp) |
Wichert Akkerman | 76baf7c | 1999-02-19 00:21:36 +0000 | [diff] [blame] | 181 | { |
| 182 | if (exiting(tcp)) { |
| 183 | if (syserror(tcp)) { |
| 184 | tprintf("%#lx, %#lx", |
| 185 | tcp->u_arg[0], tcp->u_arg[1]); |
| 186 | return 0; |
| 187 | } |
| 188 | printtv(tcp, tcp->u_arg[0]); |
Denys Vlasenko | 60fe8c1 | 2011-09-01 10:00:28 +0200 | [diff] [blame] | 189 | tprints(", "); |
Wichert Akkerman | 76baf7c | 1999-02-19 00:21:36 +0000 | [diff] [blame] | 190 | printtv(tcp, tcp->u_arg[1]); |
Wichert Akkerman | 76baf7c | 1999-02-19 00:21:36 +0000 | [diff] [blame] | 191 | } |
| 192 | return 0; |
| 193 | } |
| 194 | |
Wichert Akkerman | f5eeabb | 1999-11-18 17:09:47 +0000 | [diff] [blame] | 195 | #ifdef ALPHA |
| 196 | int |
Denys Vlasenko | 1201426 | 2011-05-30 14:00:14 +0200 | [diff] [blame] | 197 | sys_osf_gettimeofday(struct tcb *tcp) |
Wichert Akkerman | f5eeabb | 1999-11-18 17:09:47 +0000 | [diff] [blame] | 198 | { |
Denys Vlasenko | 1d63246 | 2009-04-14 12:51:00 +0000 | [diff] [blame] | 199 | if (exiting(tcp)) { |
| 200 | if (syserror(tcp)) { |
| 201 | tprintf("%#lx, %#lx", tcp->u_arg[0], tcp->u_arg[1]); |
| 202 | return 0; |
| 203 | } |
| 204 | printtv_bitness(tcp, tcp->u_arg[0], BITNESS_32, 0); |
Denys Vlasenko | 60fe8c1 | 2011-09-01 10:00:28 +0200 | [diff] [blame] | 205 | tprints(", "); |
Denys Vlasenko | 1d63246 | 2009-04-14 12:51:00 +0000 | [diff] [blame] | 206 | printtv_bitness(tcp, tcp->u_arg[1], BITNESS_32, 0); |
Denys Vlasenko | 1d63246 | 2009-04-14 12:51:00 +0000 | [diff] [blame] | 207 | } |
| 208 | return 0; |
Wichert Akkerman | f5eeabb | 1999-11-18 17:09:47 +0000 | [diff] [blame] | 209 | } |
| 210 | #endif |
| 211 | |
Wichert Akkerman | 76baf7c | 1999-02-19 00:21:36 +0000 | [diff] [blame] | 212 | int |
Denys Vlasenko | 1201426 | 2011-05-30 14:00:14 +0200 | [diff] [blame] | 213 | sys_settimeofday(struct tcb *tcp) |
Wichert Akkerman | 76baf7c | 1999-02-19 00:21:36 +0000 | [diff] [blame] | 214 | { |
| 215 | if (entering(tcp)) { |
| 216 | printtv(tcp, tcp->u_arg[0]); |
Denys Vlasenko | 60fe8c1 | 2011-09-01 10:00:28 +0200 | [diff] [blame] | 217 | tprints(", "); |
Wichert Akkerman | 76baf7c | 1999-02-19 00:21:36 +0000 | [diff] [blame] | 218 | printtv(tcp, tcp->u_arg[1]); |
Wichert Akkerman | 76baf7c | 1999-02-19 00:21:36 +0000 | [diff] [blame] | 219 | } |
| 220 | return 0; |
| 221 | } |
| 222 | |
Wichert Akkerman | f5eeabb | 1999-11-18 17:09:47 +0000 | [diff] [blame] | 223 | #ifdef ALPHA |
| 224 | int |
Denys Vlasenko | 1201426 | 2011-05-30 14:00:14 +0200 | [diff] [blame] | 225 | sys_osf_settimeofday(struct tcb *tcp) |
Wichert Akkerman | f5eeabb | 1999-11-18 17:09:47 +0000 | [diff] [blame] | 226 | { |
Denys Vlasenko | 1d63246 | 2009-04-14 12:51:00 +0000 | [diff] [blame] | 227 | if (entering(tcp)) { |
| 228 | printtv_bitness(tcp, tcp->u_arg[0], BITNESS_32, 0); |
Denys Vlasenko | 60fe8c1 | 2011-09-01 10:00:28 +0200 | [diff] [blame] | 229 | tprints(", "); |
Denys Vlasenko | 1d63246 | 2009-04-14 12:51:00 +0000 | [diff] [blame] | 230 | printtv_bitness(tcp, tcp->u_arg[1], BITNESS_32, 0); |
Denys Vlasenko | 1d63246 | 2009-04-14 12:51:00 +0000 | [diff] [blame] | 231 | } |
| 232 | return 0; |
Wichert Akkerman | f5eeabb | 1999-11-18 17:09:47 +0000 | [diff] [blame] | 233 | } |
| 234 | #endif |
| 235 | |
Wichert Akkerman | 76baf7c | 1999-02-19 00:21:36 +0000 | [diff] [blame] | 236 | int |
Denys Vlasenko | 1201426 | 2011-05-30 14:00:14 +0200 | [diff] [blame] | 237 | sys_adjtime(struct tcb *tcp) |
Wichert Akkerman | 76baf7c | 1999-02-19 00:21:36 +0000 | [diff] [blame] | 238 | { |
| 239 | if (entering(tcp)) { |
| 240 | printtv(tcp, tcp->u_arg[0]); |
Denys Vlasenko | 60fe8c1 | 2011-09-01 10:00:28 +0200 | [diff] [blame] | 241 | tprints(", "); |
Wichert Akkerman | 76baf7c | 1999-02-19 00:21:36 +0000 | [diff] [blame] | 242 | } else { |
| 243 | if (syserror(tcp)) |
| 244 | tprintf("%#lx", tcp->u_arg[1]); |
| 245 | else |
| 246 | printtv(tcp, tcp->u_arg[1]); |
| 247 | } |
| 248 | return 0; |
| 249 | } |
| 250 | |
Dmitry V. Levin | 2e55ff4 | 2008-09-03 01:02:46 +0000 | [diff] [blame] | 251 | int |
| 252 | sys_nanosleep(struct tcb *tcp) |
| 253 | { |
| 254 | if (entering(tcp)) { |
| 255 | print_timespec(tcp, tcp->u_arg[0]); |
Denys Vlasenko | 60fe8c1 | 2011-09-01 10:00:28 +0200 | [diff] [blame] | 256 | tprints(", "); |
Dmitry V. Levin | 2e55ff4 | 2008-09-03 01:02:46 +0000 | [diff] [blame] | 257 | } else { |
Denys Vlasenko | 64acaa1 | 2012-01-28 02:29:36 +0100 | [diff] [blame] | 258 | /* Second (returned) timespec is only significant |
Denys Vlasenko | 4793221 | 2013-06-30 23:53:49 +0200 | [diff] [blame] | 259 | * if syscall was interrupted. On success, we print |
| 260 | * only its address, since kernel doesn't modify it, |
| 261 | * and printing the value may show uninitialized data. |
Denys Vlasenko | 64acaa1 | 2012-01-28 02:29:36 +0100 | [diff] [blame] | 262 | */ |
Denys Vlasenko | 4793221 | 2013-06-30 23:53:49 +0200 | [diff] [blame] | 263 | switch (tcp->u_error) { |
| 264 | default: |
| 265 | /* Not interrupted (slept entire interval) */ |
| 266 | if (tcp->u_arg[1]) { |
| 267 | tprintf("%#lx", tcp->u_arg[1]); |
| 268 | break; |
| 269 | } |
| 270 | /* Fall through: print_timespec(NULL) prints "NULL" */ |
| 271 | case ERESTARTSYS: |
| 272 | case ERESTARTNOINTR: |
| 273 | case ERESTARTNOHAND: |
| 274 | case ERESTART_RESTARTBLOCK: |
| 275 | /* Interrupted */ |
Dmitry V. Levin | 2e55ff4 | 2008-09-03 01:02:46 +0000 | [diff] [blame] | 276 | print_timespec(tcp, tcp->u_arg[1]); |
Denys Vlasenko | 4793221 | 2013-06-30 23:53:49 +0200 | [diff] [blame] | 277 | } |
Dmitry V. Levin | 2e55ff4 | 2008-09-03 01:02:46 +0000 | [diff] [blame] | 278 | } |
| 279 | return 0; |
| 280 | } |
| 281 | |
Dmitry V. Levin | 0ed617b | 2014-04-25 23:30:54 +0000 | [diff] [blame] | 282 | #include "xlat/itimer_which.h" |
Wichert Akkerman | 76baf7c | 1999-02-19 00:21:36 +0000 | [diff] [blame] | 283 | |
| 284 | static void |
Dmitry V. Levin | 1cad25d | 2006-12-13 17:14:36 +0000 | [diff] [blame] | 285 | printitv_bitness(struct tcb *tcp, long addr, enum bitness_t bitness) |
Wichert Akkerman | 76baf7c | 1999-02-19 00:21:36 +0000 | [diff] [blame] | 286 | { |
Wichert Akkerman | 76baf7c | 1999-02-19 00:21:36 +0000 | [diff] [blame] | 287 | if (addr == 0) |
Denys Vlasenko | 60fe8c1 | 2011-09-01 10:00:28 +0200 | [diff] [blame] | 288 | tprints("NULL"); |
Wichert Akkerman | 76baf7c | 1999-02-19 00:21:36 +0000 | [diff] [blame] | 289 | else if (!verbose(tcp)) |
| 290 | tprintf("%#lx", addr); |
Denys Vlasenko | 1d63246 | 2009-04-14 12:51:00 +0000 | [diff] [blame] | 291 | else { |
| 292 | int rc; |
Dmitry V. Levin | 1cad25d | 2006-12-13 17:14:36 +0000 | [diff] [blame] | 293 | |
| 294 | if (bitness == BITNESS_32 |
Denys Vlasenko | 8470374 | 2012-02-25 02:38:52 +0100 | [diff] [blame] | 295 | #if SUPPORTED_PERSONALITIES > 1 |
Denys Vlasenko | 9fd4f96 | 2012-03-19 09:36:42 +0100 | [diff] [blame] | 296 | || current_wordsize == 4 |
Dmitry V. Levin | 1cad25d | 2006-12-13 17:14:36 +0000 | [diff] [blame] | 297 | #endif |
| 298 | ) |
| 299 | { |
Denys Vlasenko | 1d63246 | 2009-04-14 12:51:00 +0000 | [diff] [blame] | 300 | struct { |
Dmitry V. Levin | 1cad25d | 2006-12-13 17:14:36 +0000 | [diff] [blame] | 301 | struct timeval32 it_interval, it_value; |
| 302 | } itv; |
| 303 | |
Denys Vlasenko | 5d64581 | 2011-08-20 12:48:18 +0200 | [diff] [blame] | 304 | rc = umove(tcp, addr, &itv); |
| 305 | if (rc >= 0) { |
Denys Vlasenko | 60fe8c1 | 2011-09-01 10:00:28 +0200 | [diff] [blame] | 306 | tprints("{it_interval="); |
Dmitry V. Levin | 1cad25d | 2006-12-13 17:14:36 +0000 | [diff] [blame] | 307 | tprint_timeval32(tcp, &itv.it_interval); |
Denys Vlasenko | 60fe8c1 | 2011-09-01 10:00:28 +0200 | [diff] [blame] | 308 | tprints(", it_value="); |
Dmitry V. Levin | 1cad25d | 2006-12-13 17:14:36 +0000 | [diff] [blame] | 309 | tprint_timeval32(tcp, &itv.it_value); |
Denys Vlasenko | 60fe8c1 | 2011-09-01 10:00:28 +0200 | [diff] [blame] | 310 | tprints("}"); |
Roland McGrath | e466234 | 2007-08-02 01:25:34 +0000 | [diff] [blame] | 311 | } |
Denys Vlasenko | 1d63246 | 2009-04-14 12:51:00 +0000 | [diff] [blame] | 312 | } else { |
Dmitry V. Levin | 1cad25d | 2006-12-13 17:14:36 +0000 | [diff] [blame] | 313 | struct itimerval itv; |
| 314 | |
Denys Vlasenko | 5d64581 | 2011-08-20 12:48:18 +0200 | [diff] [blame] | 315 | rc = umove(tcp, addr, &itv); |
| 316 | if (rc >= 0) { |
Denys Vlasenko | 60fe8c1 | 2011-09-01 10:00:28 +0200 | [diff] [blame] | 317 | tprints("{it_interval="); |
Dmitry V. Levin | 1cad25d | 2006-12-13 17:14:36 +0000 | [diff] [blame] | 318 | tprint_timeval(tcp, &itv.it_interval); |
Denys Vlasenko | 60fe8c1 | 2011-09-01 10:00:28 +0200 | [diff] [blame] | 319 | tprints(", it_value="); |
Dmitry V. Levin | 1cad25d | 2006-12-13 17:14:36 +0000 | [diff] [blame] | 320 | tprint_timeval(tcp, &itv.it_value); |
Denys Vlasenko | 60fe8c1 | 2011-09-01 10:00:28 +0200 | [diff] [blame] | 321 | tprints("}"); |
Roland McGrath | e466234 | 2007-08-02 01:25:34 +0000 | [diff] [blame] | 322 | } |
Dmitry V. Levin | 1cad25d | 2006-12-13 17:14:36 +0000 | [diff] [blame] | 323 | } |
Dmitry V. Levin | 1cad25d | 2006-12-13 17:14:36 +0000 | [diff] [blame] | 324 | if (rc < 0) |
Denys Vlasenko | 60fe8c1 | 2011-09-01 10:00:28 +0200 | [diff] [blame] | 325 | tprints("{...}"); |
Wichert Akkerman | 76baf7c | 1999-02-19 00:21:36 +0000 | [diff] [blame] | 326 | } |
| 327 | } |
| 328 | |
Dmitry V. Levin | 1cad25d | 2006-12-13 17:14:36 +0000 | [diff] [blame] | 329 | #define printitv(tcp, addr) \ |
| 330 | printitv_bitness((tcp), (addr), BITNESS_CURRENT) |
Wichert Akkerman | f5eeabb | 1999-11-18 17:09:47 +0000 | [diff] [blame] | 331 | |
Wichert Akkerman | 76baf7c | 1999-02-19 00:21:36 +0000 | [diff] [blame] | 332 | int |
Denys Vlasenko | 1201426 | 2011-05-30 14:00:14 +0200 | [diff] [blame] | 333 | sys_getitimer(struct tcb *tcp) |
Wichert Akkerman | 76baf7c | 1999-02-19 00:21:36 +0000 | [diff] [blame] | 334 | { |
| 335 | if (entering(tcp)) { |
Dmitry V. Levin | 297b594 | 2014-04-25 23:39:20 +0000 | [diff] [blame] | 336 | printxval(itimer_which, tcp->u_arg[0], "ITIMER_???"); |
Denys Vlasenko | 60fe8c1 | 2011-09-01 10:00:28 +0200 | [diff] [blame] | 337 | tprints(", "); |
Wichert Akkerman | 76baf7c | 1999-02-19 00:21:36 +0000 | [diff] [blame] | 338 | } else { |
| 339 | if (syserror(tcp)) |
| 340 | tprintf("%#lx", tcp->u_arg[1]); |
| 341 | else |
| 342 | printitv(tcp, tcp->u_arg[1]); |
| 343 | } |
| 344 | return 0; |
| 345 | } |
| 346 | |
Wichert Akkerman | f5eeabb | 1999-11-18 17:09:47 +0000 | [diff] [blame] | 347 | #ifdef ALPHA |
| 348 | int |
Denys Vlasenko | 1201426 | 2011-05-30 14:00:14 +0200 | [diff] [blame] | 349 | sys_osf_getitimer(struct tcb *tcp) |
Wichert Akkerman | f5eeabb | 1999-11-18 17:09:47 +0000 | [diff] [blame] | 350 | { |
Denys Vlasenko | 1d63246 | 2009-04-14 12:51:00 +0000 | [diff] [blame] | 351 | if (entering(tcp)) { |
Dmitry V. Levin | 297b594 | 2014-04-25 23:39:20 +0000 | [diff] [blame] | 352 | printxval(itimer_which, tcp->u_arg[0], "ITIMER_???"); |
Denys Vlasenko | 60fe8c1 | 2011-09-01 10:00:28 +0200 | [diff] [blame] | 353 | tprints(", "); |
Denys Vlasenko | 1d63246 | 2009-04-14 12:51:00 +0000 | [diff] [blame] | 354 | } else { |
| 355 | if (syserror(tcp)) |
| 356 | tprintf("%#lx", tcp->u_arg[1]); |
| 357 | else |
| 358 | printitv_bitness(tcp, tcp->u_arg[1], BITNESS_32); |
| 359 | } |
| 360 | return 0; |
Wichert Akkerman | f5eeabb | 1999-11-18 17:09:47 +0000 | [diff] [blame] | 361 | } |
| 362 | #endif |
| 363 | |
Wichert Akkerman | 76baf7c | 1999-02-19 00:21:36 +0000 | [diff] [blame] | 364 | int |
Denys Vlasenko | 1201426 | 2011-05-30 14:00:14 +0200 | [diff] [blame] | 365 | sys_setitimer(struct tcb *tcp) |
Wichert Akkerman | 76baf7c | 1999-02-19 00:21:36 +0000 | [diff] [blame] | 366 | { |
| 367 | if (entering(tcp)) { |
Dmitry V. Levin | 297b594 | 2014-04-25 23:39:20 +0000 | [diff] [blame] | 368 | printxval(itimer_which, tcp->u_arg[0], "ITIMER_???"); |
Denys Vlasenko | 60fe8c1 | 2011-09-01 10:00:28 +0200 | [diff] [blame] | 369 | tprints(", "); |
Wichert Akkerman | 76baf7c | 1999-02-19 00:21:36 +0000 | [diff] [blame] | 370 | printitv(tcp, tcp->u_arg[1]); |
Denys Vlasenko | 60fe8c1 | 2011-09-01 10:00:28 +0200 | [diff] [blame] | 371 | tprints(", "); |
Wichert Akkerman | 76baf7c | 1999-02-19 00:21:36 +0000 | [diff] [blame] | 372 | } else { |
| 373 | if (syserror(tcp)) |
| 374 | tprintf("%#lx", tcp->u_arg[2]); |
| 375 | else |
| 376 | printitv(tcp, tcp->u_arg[2]); |
| 377 | } |
| 378 | return 0; |
| 379 | } |
| 380 | |
Wichert Akkerman | f5eeabb | 1999-11-18 17:09:47 +0000 | [diff] [blame] | 381 | #ifdef ALPHA |
| 382 | int |
Denys Vlasenko | 1201426 | 2011-05-30 14:00:14 +0200 | [diff] [blame] | 383 | sys_osf_setitimer(struct tcb *tcp) |
Wichert Akkerman | f5eeabb | 1999-11-18 17:09:47 +0000 | [diff] [blame] | 384 | { |
Denys Vlasenko | 1d63246 | 2009-04-14 12:51:00 +0000 | [diff] [blame] | 385 | if (entering(tcp)) { |
Dmitry V. Levin | 297b594 | 2014-04-25 23:39:20 +0000 | [diff] [blame] | 386 | printxval(itimer_which, tcp->u_arg[0], "ITIMER_???"); |
Denys Vlasenko | 60fe8c1 | 2011-09-01 10:00:28 +0200 | [diff] [blame] | 387 | tprints(", "); |
Denys Vlasenko | 1d63246 | 2009-04-14 12:51:00 +0000 | [diff] [blame] | 388 | printitv_bitness(tcp, tcp->u_arg[1], BITNESS_32); |
Denys Vlasenko | 60fe8c1 | 2011-09-01 10:00:28 +0200 | [diff] [blame] | 389 | tprints(", "); |
Denys Vlasenko | 1d63246 | 2009-04-14 12:51:00 +0000 | [diff] [blame] | 390 | } else { |
| 391 | if (syserror(tcp)) |
| 392 | tprintf("%#lx", tcp->u_arg[2]); |
| 393 | else |
| 394 | printitv_bitness(tcp, tcp->u_arg[2], BITNESS_32); |
| 395 | } |
| 396 | return 0; |
Wichert Akkerman | f5eeabb | 1999-11-18 17:09:47 +0000 | [diff] [blame] | 397 | } |
| 398 | #endif |
| 399 | |
Dmitry V. Levin | 0ed617b | 2014-04-25 23:30:54 +0000 | [diff] [blame] | 400 | #include "xlat/adjtimex_modes.h" |
Dmitry V. Levin | 0ed617b | 2014-04-25 23:30:54 +0000 | [diff] [blame] | 401 | #include "xlat/adjtimex_status.h" |
Dmitry V. Levin | 0ed617b | 2014-04-25 23:30:54 +0000 | [diff] [blame] | 402 | #include "xlat/adjtimex_state.h" |
Dmitry V. Levin | 1a684d6 | 2006-12-13 17:42:32 +0000 | [diff] [blame] | 403 | |
Dmitry V. Levin | 165b15d | 2006-12-13 17:43:45 +0000 | [diff] [blame] | 404 | #if SUPPORTED_PERSONALITIES > 1 |
| 405 | static int |
| 406 | tprint_timex32(struct tcb *tcp, long addr) |
| 407 | { |
Denys Vlasenko | 1d63246 | 2009-04-14 12:51:00 +0000 | [diff] [blame] | 408 | struct { |
Dmitry V. Levin | 165b15d | 2006-12-13 17:43:45 +0000 | [diff] [blame] | 409 | unsigned int modes; |
| 410 | int offset; |
| 411 | int freq; |
| 412 | int maxerror; |
| 413 | int esterror; |
| 414 | int status; |
| 415 | int constant; |
| 416 | int precision; |
| 417 | int tolerance; |
| 418 | struct timeval32 time; |
| 419 | int tick; |
| 420 | int ppsfreq; |
| 421 | int jitter; |
| 422 | int shift; |
| 423 | int stabil; |
| 424 | int jitcnt; |
| 425 | int calcnt; |
| 426 | int errcnt; |
| 427 | int stbcnt; |
| 428 | } tx; |
| 429 | |
| 430 | if (umove(tcp, addr, &tx) < 0) |
| 431 | return -1; |
| 432 | |
Denys Vlasenko | 60fe8c1 | 2011-09-01 10:00:28 +0200 | [diff] [blame] | 433 | tprints("{modes="); |
Dmitry V. Levin | 71d7089 | 2007-01-13 11:17:38 +0000 | [diff] [blame] | 434 | printflags(adjtimex_modes, tx.modes, "ADJ_???"); |
Dmitry V. Levin | 165b15d | 2006-12-13 17:43:45 +0000 | [diff] [blame] | 435 | tprintf(", offset=%d, freq=%d, maxerror=%d, ", |
| 436 | tx.offset, tx.freq, tx.maxerror); |
| 437 | tprintf("esterror=%u, status=", tx.esterror); |
| 438 | printflags(adjtimex_status, tx.status, "STA_???"); |
| 439 | tprintf(", constant=%d, precision=%u, ", |
| 440 | tx.constant, tx.precision); |
| 441 | tprintf("tolerance=%d, time=", tx.tolerance); |
| 442 | tprint_timeval32(tcp, &tx.time); |
| 443 | tprintf(", tick=%d, ppsfreq=%d, jitter=%d", |
| 444 | tx.tick, tx.ppsfreq, tx.jitter); |
| 445 | tprintf(", shift=%d, stabil=%d, jitcnt=%d", |
| 446 | tx.shift, tx.stabil, tx.jitcnt); |
| 447 | tprintf(", calcnt=%d, errcnt=%d, stbcnt=%d", |
| 448 | tx.calcnt, tx.errcnt, tx.stbcnt); |
Denys Vlasenko | 60fe8c1 | 2011-09-01 10:00:28 +0200 | [diff] [blame] | 449 | tprints("}"); |
Dmitry V. Levin | 165b15d | 2006-12-13 17:43:45 +0000 | [diff] [blame] | 450 | return 0; |
| 451 | } |
| 452 | #endif /* SUPPORTED_PERSONALITIES > 1 */ |
| 453 | |
| 454 | static int |
| 455 | tprint_timex(struct tcb *tcp, long addr) |
Wichert Akkerman | 76baf7c | 1999-02-19 00:21:36 +0000 | [diff] [blame] | 456 | { |
Dmitry V. Levin | 1a684d6 | 2006-12-13 17:42:32 +0000 | [diff] [blame] | 457 | struct timex tx; |
Wichert Akkerman | 76baf7c | 1999-02-19 00:21:36 +0000 | [diff] [blame] | 458 | |
Dmitry V. Levin | 165b15d | 2006-12-13 17:43:45 +0000 | [diff] [blame] | 459 | #if SUPPORTED_PERSONALITIES > 1 |
Denys Vlasenko | 9fd4f96 | 2012-03-19 09:36:42 +0100 | [diff] [blame] | 460 | if (current_wordsize == 4) |
Dmitry V. Levin | 165b15d | 2006-12-13 17:43:45 +0000 | [diff] [blame] | 461 | return tprint_timex32(tcp, addr); |
| 462 | #endif |
| 463 | if (umove(tcp, addr, &tx) < 0) |
| 464 | return -1; |
| 465 | |
| 466 | #if LINUX_VERSION_CODE < 66332 |
| 467 | tprintf("{mode=%d, offset=%ld, frequency=%ld, ", |
| 468 | tx.mode, tx.offset, tx.frequency); |
| 469 | tprintf("maxerror=%ld, esterror=%lu, status=%u, ", |
| 470 | tx.maxerror, tx.esterror, tx.status); |
| 471 | tprintf("time_constant=%ld, precision=%lu, ", |
| 472 | tx.time_constant, tx.precision); |
| 473 | tprintf("tolerance=%ld, time=", tx.tolerance); |
| 474 | tprint_timeval(tcp, &tx.time); |
| 475 | #else |
Denys Vlasenko | 60fe8c1 | 2011-09-01 10:00:28 +0200 | [diff] [blame] | 476 | tprints("{modes="); |
Dmitry V. Levin | 71d7089 | 2007-01-13 11:17:38 +0000 | [diff] [blame] | 477 | printflags(adjtimex_modes, tx.modes, "ADJ_???"); |
Dmitry V. Levin | 165b15d | 2006-12-13 17:43:45 +0000 | [diff] [blame] | 478 | tprintf(", offset=%ld, freq=%ld, maxerror=%ld, ", |
H.J. Lu | 0b315b6 | 2012-02-03 10:16:03 -0800 | [diff] [blame] | 479 | (long) tx.offset, (long) tx.freq, (long) tx.maxerror); |
| 480 | tprintf("esterror=%lu, status=", (long) tx.esterror); |
Dmitry V. Levin | 165b15d | 2006-12-13 17:43:45 +0000 | [diff] [blame] | 481 | printflags(adjtimex_status, tx.status, "STA_???"); |
| 482 | tprintf(", constant=%ld, precision=%lu, ", |
H.J. Lu | 0b315b6 | 2012-02-03 10:16:03 -0800 | [diff] [blame] | 483 | (long) tx.constant, (long) tx.precision); |
| 484 | tprintf("tolerance=%ld, time=", (long) tx.tolerance); |
Dmitry V. Levin | 165b15d | 2006-12-13 17:43:45 +0000 | [diff] [blame] | 485 | tprint_timeval(tcp, &tx.time); |
| 486 | tprintf(", tick=%ld, ppsfreq=%ld, jitter=%ld", |
H.J. Lu | 0b315b6 | 2012-02-03 10:16:03 -0800 | [diff] [blame] | 487 | (long) tx.tick, (long) tx.ppsfreq, (long) tx.jitter); |
Dmitry V. Levin | 165b15d | 2006-12-13 17:43:45 +0000 | [diff] [blame] | 488 | tprintf(", shift=%d, stabil=%ld, jitcnt=%ld", |
H.J. Lu | 0b315b6 | 2012-02-03 10:16:03 -0800 | [diff] [blame] | 489 | tx.shift, (long) tx.stabil, (long) tx.jitcnt); |
Dmitry V. Levin | 165b15d | 2006-12-13 17:43:45 +0000 | [diff] [blame] | 490 | tprintf(", calcnt=%ld, errcnt=%ld, stbcnt=%ld", |
H.J. Lu | 0b315b6 | 2012-02-03 10:16:03 -0800 | [diff] [blame] | 491 | (long) tx.calcnt, (long) tx.errcnt, (long) tx.stbcnt); |
Dmitry V. Levin | 165b15d | 2006-12-13 17:43:45 +0000 | [diff] [blame] | 492 | #endif |
Denys Vlasenko | 60fe8c1 | 2011-09-01 10:00:28 +0200 | [diff] [blame] | 493 | tprints("}"); |
Dmitry V. Levin | 165b15d | 2006-12-13 17:43:45 +0000 | [diff] [blame] | 494 | return 0; |
| 495 | } |
| 496 | |
Dmitry V. Levin | 7321547 | 2012-03-11 21:25:51 +0000 | [diff] [blame] | 497 | static int |
| 498 | do_adjtimex(struct tcb *tcp, long addr) |
| 499 | { |
| 500 | if (addr == 0) |
| 501 | tprints("NULL"); |
| 502 | else if (syserror(tcp) || !verbose(tcp)) |
| 503 | tprintf("%#lx", addr); |
| 504 | else if (tprint_timex(tcp, addr) < 0) |
| 505 | tprints("{...}"); |
| 506 | if (syserror(tcp)) |
| 507 | return 0; |
| 508 | tcp->auxstr = xlookup(adjtimex_state, tcp->u_rval); |
| 509 | if (tcp->auxstr) |
| 510 | return RVAL_STR; |
| 511 | return 0; |
| 512 | } |
| 513 | |
Dmitry V. Levin | 165b15d | 2006-12-13 17:43:45 +0000 | [diff] [blame] | 514 | int |
| 515 | sys_adjtimex(struct tcb *tcp) |
| 516 | { |
Dmitry V. Levin | 7321547 | 2012-03-11 21:25:51 +0000 | [diff] [blame] | 517 | if (exiting(tcp)) |
| 518 | return do_adjtimex(tcp, tcp->u_arg[0]); |
Wichert Akkerman | 76baf7c | 1999-02-19 00:21:36 +0000 | [diff] [blame] | 519 | return 0; |
| 520 | } |
Roland McGrath | 1e35679 | 2003-03-30 23:52:28 +0000 | [diff] [blame] | 521 | |
Dmitry V. Levin | 0ed617b | 2014-04-25 23:30:54 +0000 | [diff] [blame] | 522 | #include "xlat/clockflags.h" |
Dmitry V. Levin | 0ed617b | 2014-04-25 23:30:54 +0000 | [diff] [blame] | 523 | #include "xlat/clocknames.h" |
Roland McGrath | 54a4edd | 2004-08-31 06:52:45 +0000 | [diff] [blame] | 524 | |
Stefan Sørensen | a5fea90 | 2014-02-03 10:01:27 +0100 | [diff] [blame] | 525 | static void |
| 526 | printclockname(int clockid) |
| 527 | { |
| 528 | #ifdef CLOCKID_TO_FD |
Dmitry V. Levin | d35bdca | 2014-04-26 18:10:19 +0000 | [diff] [blame] | 529 | # include "xlat/cpuclocknames.h" |
| 530 | |
Stefan Sørensen | a5fea90 | 2014-02-03 10:01:27 +0100 | [diff] [blame] | 531 | if (clockid < 0) { |
| 532 | if ((clockid & CLOCKFD_MASK) == CLOCKFD) |
| 533 | tprintf("FD_TO_CLOCKID(%d)", CLOCKID_TO_FD(clockid)); |
| 534 | else { |
| 535 | if(CPUCLOCK_PERTHREAD(clockid)) |
| 536 | tprintf("MAKE_THREAD_CPUCLOCK(%d,", CPUCLOCK_PID(clockid)); |
| 537 | else |
| 538 | tprintf("MAKE_PROCESS_CPUCLOCK(%d,", CPUCLOCK_PID(clockid)); |
| 539 | printxval(cpuclocknames, clockid & CLOCKFD_MASK, "CPUCLOCK_???"); |
| 540 | tprints(")"); |
| 541 | } |
| 542 | } |
| 543 | else |
| 544 | #endif |
| 545 | printxval(clocknames, clockid, "CLOCK_???"); |
| 546 | } |
| 547 | |
Roland McGrath | 1e35679 | 2003-03-30 23:52:28 +0000 | [diff] [blame] | 548 | int |
Denys Vlasenko | 1201426 | 2011-05-30 14:00:14 +0200 | [diff] [blame] | 549 | sys_clock_settime(struct tcb *tcp) |
Roland McGrath | 1e35679 | 2003-03-30 23:52:28 +0000 | [diff] [blame] | 550 | { |
| 551 | if (entering(tcp)) { |
Stefan Sørensen | a5fea90 | 2014-02-03 10:01:27 +0100 | [diff] [blame] | 552 | printclockname(tcp->u_arg[0]); |
Denys Vlasenko | 60fe8c1 | 2011-09-01 10:00:28 +0200 | [diff] [blame] | 553 | tprints(", "); |
Roland McGrath | 1e35679 | 2003-03-30 23:52:28 +0000 | [diff] [blame] | 554 | printtv(tcp, tcp->u_arg[1]); |
| 555 | } |
| 556 | return 0; |
| 557 | } |
| 558 | |
| 559 | int |
Denys Vlasenko | 1201426 | 2011-05-30 14:00:14 +0200 | [diff] [blame] | 560 | sys_clock_gettime(struct tcb *tcp) |
Roland McGrath | 1e35679 | 2003-03-30 23:52:28 +0000 | [diff] [blame] | 561 | { |
| 562 | if (entering(tcp)) { |
Stefan Sørensen | a5fea90 | 2014-02-03 10:01:27 +0100 | [diff] [blame] | 563 | printclockname(tcp->u_arg[0]); |
Denys Vlasenko | 60fe8c1 | 2011-09-01 10:00:28 +0200 | [diff] [blame] | 564 | tprints(", "); |
Roland McGrath | 1e35679 | 2003-03-30 23:52:28 +0000 | [diff] [blame] | 565 | } else { |
| 566 | if (syserror(tcp)) |
| 567 | tprintf("%#lx", tcp->u_arg[1]); |
| 568 | else |
| 569 | printtv(tcp, tcp->u_arg[1]); |
| 570 | } |
| 571 | return 0; |
| 572 | } |
| 573 | |
| 574 | int |
Denys Vlasenko | 1201426 | 2011-05-30 14:00:14 +0200 | [diff] [blame] | 575 | sys_clock_nanosleep(struct tcb *tcp) |
Roland McGrath | 1e35679 | 2003-03-30 23:52:28 +0000 | [diff] [blame] | 576 | { |
| 577 | if (entering(tcp)) { |
Stefan Sørensen | a5fea90 | 2014-02-03 10:01:27 +0100 | [diff] [blame] | 578 | printclockname(tcp->u_arg[0]); |
Denys Vlasenko | 60fe8c1 | 2011-09-01 10:00:28 +0200 | [diff] [blame] | 579 | tprints(", "); |
Roland McGrath | b2dee13 | 2005-06-01 19:02:36 +0000 | [diff] [blame] | 580 | printflags(clockflags, tcp->u_arg[1], "TIMER_???"); |
Denys Vlasenko | 60fe8c1 | 2011-09-01 10:00:28 +0200 | [diff] [blame] | 581 | tprints(", "); |
Roland McGrath | 1e35679 | 2003-03-30 23:52:28 +0000 | [diff] [blame] | 582 | printtv(tcp, tcp->u_arg[2]); |
Denys Vlasenko | 60fe8c1 | 2011-09-01 10:00:28 +0200 | [diff] [blame] | 583 | tprints(", "); |
Roland McGrath | 1e35679 | 2003-03-30 23:52:28 +0000 | [diff] [blame] | 584 | } else { |
| 585 | if (syserror(tcp)) |
| 586 | tprintf("%#lx", tcp->u_arg[3]); |
| 587 | else |
| 588 | printtv(tcp, tcp->u_arg[3]); |
| 589 | } |
| 590 | return 0; |
| 591 | } |
| 592 | |
Dmitry V. Levin | 7321547 | 2012-03-11 21:25:51 +0000 | [diff] [blame] | 593 | int |
| 594 | sys_clock_adjtime(struct tcb *tcp) |
| 595 | { |
| 596 | if (exiting(tcp)) |
| 597 | return do_adjtimex(tcp, tcp->u_arg[1]); |
Stefan Sørensen | a5fea90 | 2014-02-03 10:01:27 +0100 | [diff] [blame] | 598 | printclockname(tcp->u_arg[0]); |
Dmitry V. Levin | 7321547 | 2012-03-11 21:25:51 +0000 | [diff] [blame] | 599 | tprints(", "); |
| 600 | return 0; |
| 601 | } |
| 602 | |
Roland McGrath | 1e35679 | 2003-03-30 23:52:28 +0000 | [diff] [blame] | 603 | #ifndef SIGEV_THREAD_ID |
| 604 | # define SIGEV_THREAD_ID 4 |
| 605 | #endif |
Dmitry V. Levin | 0ed617b | 2014-04-25 23:30:54 +0000 | [diff] [blame] | 606 | #include "xlat/sigev_value.h" |
Roland McGrath | 1e35679 | 2003-03-30 23:52:28 +0000 | [diff] [blame] | 607 | |
Dmitry V. Levin | d3cb392 | 2006-12-13 17:45:02 +0000 | [diff] [blame] | 608 | #if SUPPORTED_PERSONALITIES > 1 |
| 609 | static void |
| 610 | printsigevent32(struct tcb *tcp, long arg) |
| 611 | { |
Denys Vlasenko | 1d63246 | 2009-04-14 12:51:00 +0000 | [diff] [blame] | 612 | struct { |
Dmitry V. Levin | d3cb392 | 2006-12-13 17:45:02 +0000 | [diff] [blame] | 613 | int sigev_value; |
| 614 | int sigev_signo; |
| 615 | int sigev_notify; |
| 616 | |
Denys Vlasenko | 1d63246 | 2009-04-14 12:51:00 +0000 | [diff] [blame] | 617 | union { |
Dmitry V. Levin | d3cb392 | 2006-12-13 17:45:02 +0000 | [diff] [blame] | 618 | int tid; |
Denys Vlasenko | 1d63246 | 2009-04-14 12:51:00 +0000 | [diff] [blame] | 619 | struct { |
Dmitry V. Levin | d3cb392 | 2006-12-13 17:45:02 +0000 | [diff] [blame] | 620 | int function, attribute; |
| 621 | } thread; |
| 622 | } un; |
| 623 | } sev; |
| 624 | |
| 625 | if (umove(tcp, arg, &sev) < 0) |
Denys Vlasenko | 60fe8c1 | 2011-09-01 10:00:28 +0200 | [diff] [blame] | 626 | tprints("{...}"); |
Denys Vlasenko | 1d63246 | 2009-04-14 12:51:00 +0000 | [diff] [blame] | 627 | else { |
Dmitry V. Levin | d3cb392 | 2006-12-13 17:45:02 +0000 | [diff] [blame] | 628 | tprintf("{%#x, ", sev.sigev_value); |
| 629 | if (sev.sigev_notify == SIGEV_SIGNAL) |
| 630 | tprintf("%s, ", signame(sev.sigev_signo)); |
| 631 | else |
| 632 | tprintf("%u, ", sev.sigev_signo); |
Dmitry V. Levin | bae549e | 2014-02-05 01:46:10 +0000 | [diff] [blame] | 633 | printxval(sigev_value, sev.sigev_notify, "SIGEV_???"); |
Denys Vlasenko | 60fe8c1 | 2011-09-01 10:00:28 +0200 | [diff] [blame] | 634 | tprints(", "); |
Dmitry V. Levin | d3cb392 | 2006-12-13 17:45:02 +0000 | [diff] [blame] | 635 | if (sev.sigev_notify == SIGEV_THREAD_ID) |
| 636 | tprintf("{%d}", sev.un.tid); |
| 637 | else if (sev.sigev_notify == SIGEV_THREAD) |
| 638 | tprintf("{%#x, %#x}", |
| 639 | sev.un.thread.function, |
| 640 | sev.un.thread.attribute); |
| 641 | else |
Denys Vlasenko | 60fe8c1 | 2011-09-01 10:00:28 +0200 | [diff] [blame] | 642 | tprints("{...}"); |
| 643 | tprints("}"); |
Dmitry V. Levin | d3cb392 | 2006-12-13 17:45:02 +0000 | [diff] [blame] | 644 | } |
| 645 | } |
| 646 | #endif |
| 647 | |
Roland McGrath | 1e35679 | 2003-03-30 23:52:28 +0000 | [diff] [blame] | 648 | void |
Dmitry V. Levin | d3cb392 | 2006-12-13 17:45:02 +0000 | [diff] [blame] | 649 | printsigevent(struct tcb *tcp, long arg) |
Roland McGrath | 1e35679 | 2003-03-30 23:52:28 +0000 | [diff] [blame] | 650 | { |
| 651 | struct sigevent sev; |
Dmitry V. Levin | d3cb392 | 2006-12-13 17:45:02 +0000 | [diff] [blame] | 652 | |
| 653 | #if SUPPORTED_PERSONALITIES > 1 |
Denys Vlasenko | 9fd4f96 | 2012-03-19 09:36:42 +0100 | [diff] [blame] | 654 | if (current_wordsize == 4) { |
Dmitry V. Levin | d3cb392 | 2006-12-13 17:45:02 +0000 | [diff] [blame] | 655 | printsigevent32(tcp, arg); |
| 656 | return; |
| 657 | } |
| 658 | #endif |
Denys Vlasenko | b63256e | 2011-06-07 12:13:24 +0200 | [diff] [blame] | 659 | if (umove(tcp, arg, &sev) < 0) |
Denys Vlasenko | 60fe8c1 | 2011-09-01 10:00:28 +0200 | [diff] [blame] | 660 | tprints("{...}"); |
Roland McGrath | 1e35679 | 2003-03-30 23:52:28 +0000 | [diff] [blame] | 661 | else { |
Roland McGrath | 675d4a6 | 2004-09-11 08:12:45 +0000 | [diff] [blame] | 662 | tprintf("{%p, ", sev.sigev_value.sival_ptr); |
| 663 | if (sev.sigev_notify == SIGEV_SIGNAL) |
| 664 | tprintf("%s, ", signame(sev.sigev_signo)); |
| 665 | else |
| 666 | tprintf("%u, ", sev.sigev_signo); |
Dmitry V. Levin | bae549e | 2014-02-05 01:46:10 +0000 | [diff] [blame] | 667 | printxval(sigev_value, sev.sigev_notify, "SIGEV_???"); |
Denys Vlasenko | 60fe8c1 | 2011-09-01 10:00:28 +0200 | [diff] [blame] | 668 | tprints(", "); |
Roland McGrath | 1e35679 | 2003-03-30 23:52:28 +0000 | [diff] [blame] | 669 | if (sev.sigev_notify == SIGEV_THREAD_ID) |
Dmitry V. Levin | ae5aa47 | 2013-11-11 23:54:30 +0000 | [diff] [blame] | 670 | #if defined(HAVE_STRUCT_SIGEVENT__SIGEV_UN__PAD) |
Roland McGrath | 1e35679 | 2003-03-30 23:52:28 +0000 | [diff] [blame] | 671 | /* _pad[0] is the _tid field which might not be |
| 672 | present in the userlevel definition of the |
| 673 | struct. */ |
| 674 | tprintf("{%d}", sev._sigev_un._pad[0]); |
Dmitry V. Levin | ae5aa47 | 2013-11-11 23:54:30 +0000 | [diff] [blame] | 675 | #elif defined(HAVE_STRUCT_SIGEVENT___PAD) |
| 676 | tprintf("{%d}", sev.__pad[0]); |
| 677 | #else |
| 678 | # warning unfamiliar struct sigevent => incomplete SIGEV_THREAD_ID decoding |
| 679 | tprints("{...}"); |
| 680 | #endif |
Roland McGrath | d4c85eb | 2004-04-16 21:48:44 +0000 | [diff] [blame] | 681 | else if (sev.sigev_notify == SIGEV_THREAD) |
| 682 | tprintf("{%p, %p}", sev.sigev_notify_function, |
| 683 | sev.sigev_notify_attributes); |
Roland McGrath | 1e35679 | 2003-03-30 23:52:28 +0000 | [diff] [blame] | 684 | else |
Denys Vlasenko | 60fe8c1 | 2011-09-01 10:00:28 +0200 | [diff] [blame] | 685 | tprints("{...}"); |
| 686 | tprints("}"); |
Roland McGrath | 1e35679 | 2003-03-30 23:52:28 +0000 | [diff] [blame] | 687 | } |
| 688 | } |
| 689 | |
| 690 | int |
Denys Vlasenko | 1201426 | 2011-05-30 14:00:14 +0200 | [diff] [blame] | 691 | sys_timer_create(struct tcb *tcp) |
Roland McGrath | 1e35679 | 2003-03-30 23:52:28 +0000 | [diff] [blame] | 692 | { |
| 693 | if (entering(tcp)) { |
Stefan Sørensen | a5fea90 | 2014-02-03 10:01:27 +0100 | [diff] [blame] | 694 | printclockname(tcp->u_arg[0]); |
Denys Vlasenko | 60fe8c1 | 2011-09-01 10:00:28 +0200 | [diff] [blame] | 695 | tprints(", "); |
Roland McGrath | 1e35679 | 2003-03-30 23:52:28 +0000 | [diff] [blame] | 696 | printsigevent(tcp, tcp->u_arg[1]); |
Denys Vlasenko | 60fe8c1 | 2011-09-01 10:00:28 +0200 | [diff] [blame] | 697 | tprints(", "); |
Roland McGrath | 1e35679 | 2003-03-30 23:52:28 +0000 | [diff] [blame] | 698 | } else { |
Andi Kleen | 732f396 | 2011-06-13 21:37:40 +0000 | [diff] [blame] | 699 | int timer_id; |
Dmitry V. Levin | ac518d1 | 2006-12-13 17:03:02 +0000 | [diff] [blame] | 700 | |
Andi Kleen | 732f396 | 2011-06-13 21:37:40 +0000 | [diff] [blame] | 701 | if (syserror(tcp) || umove(tcp, tcp->u_arg[2], &timer_id) < 0) |
Roland McGrath | 1e35679 | 2003-03-30 23:52:28 +0000 | [diff] [blame] | 702 | tprintf("%#lx", tcp->u_arg[2]); |
Dmitry V. Levin | ac518d1 | 2006-12-13 17:03:02 +0000 | [diff] [blame] | 703 | else |
Andi Kleen | 732f396 | 2011-06-13 21:37:40 +0000 | [diff] [blame] | 704 | tprintf("{%d}", timer_id); |
Roland McGrath | 1e35679 | 2003-03-30 23:52:28 +0000 | [diff] [blame] | 705 | } |
| 706 | return 0; |
| 707 | } |
| 708 | |
| 709 | int |
Denys Vlasenko | 1201426 | 2011-05-30 14:00:14 +0200 | [diff] [blame] | 710 | sys_timer_settime(struct tcb *tcp) |
Roland McGrath | 1e35679 | 2003-03-30 23:52:28 +0000 | [diff] [blame] | 711 | { |
| 712 | if (entering(tcp)) { |
| 713 | tprintf("%#lx, ", tcp->u_arg[0]); |
Roland McGrath | b2dee13 | 2005-06-01 19:02:36 +0000 | [diff] [blame] | 714 | printflags(clockflags, tcp->u_arg[1], "TIMER_???"); |
Denys Vlasenko | 60fe8c1 | 2011-09-01 10:00:28 +0200 | [diff] [blame] | 715 | tprints(", "); |
Roland McGrath | 1e35679 | 2003-03-30 23:52:28 +0000 | [diff] [blame] | 716 | printitv(tcp, tcp->u_arg[2]); |
Denys Vlasenko | 60fe8c1 | 2011-09-01 10:00:28 +0200 | [diff] [blame] | 717 | tprints(", "); |
Roland McGrath | 1e35679 | 2003-03-30 23:52:28 +0000 | [diff] [blame] | 718 | } else { |
| 719 | if (syserror(tcp)) |
| 720 | tprintf("%#lx", tcp->u_arg[3]); |
| 721 | else |
| 722 | printitv(tcp, tcp->u_arg[3]); |
| 723 | } |
| 724 | return 0; |
| 725 | } |
| 726 | |
| 727 | int |
Denys Vlasenko | 1201426 | 2011-05-30 14:00:14 +0200 | [diff] [blame] | 728 | sys_timer_gettime(struct tcb *tcp) |
Roland McGrath | 1e35679 | 2003-03-30 23:52:28 +0000 | [diff] [blame] | 729 | { |
| 730 | if (entering(tcp)) { |
| 731 | tprintf("%#lx, ", tcp->u_arg[0]); |
| 732 | } else { |
| 733 | if (syserror(tcp)) |
| 734 | tprintf("%#lx", tcp->u_arg[1]); |
| 735 | else |
| 736 | printitv(tcp, tcp->u_arg[1]); |
| 737 | } |
| 738 | return 0; |
| 739 | } |
Roland McGrath | d83c50b | 2004-10-06 22:27:43 +0000 | [diff] [blame] | 740 | |
| 741 | static void |
Denys Vlasenko | 1201426 | 2011-05-30 14:00:14 +0200 | [diff] [blame] | 742 | print_rtc(struct tcb *tcp, const struct rtc_time *rt) |
Roland McGrath | d83c50b | 2004-10-06 22:27:43 +0000 | [diff] [blame] | 743 | { |
| 744 | tprintf("{tm_sec=%d, tm_min=%d, tm_hour=%d, " |
| 745 | "tm_mday=%d, tm_mon=%d, tm_year=%d, ", |
| 746 | rt->tm_sec, rt->tm_min, rt->tm_hour, |
| 747 | rt->tm_mday, rt->tm_mon, rt->tm_year); |
| 748 | if (!abbrev(tcp)) |
| 749 | tprintf("tm_wday=%d, tm_yday=%d, tm_isdst=%d}", |
| 750 | rt->tm_wday, rt->tm_yday, rt->tm_isdst); |
| 751 | else |
Denys Vlasenko | 60fe8c1 | 2011-09-01 10:00:28 +0200 | [diff] [blame] | 752 | tprints("...}"); |
Roland McGrath | d83c50b | 2004-10-06 22:27:43 +0000 | [diff] [blame] | 753 | } |
| 754 | |
| 755 | int |
Denys Vlasenko | 1201426 | 2011-05-30 14:00:14 +0200 | [diff] [blame] | 756 | rtc_ioctl(struct tcb *tcp, long code, long arg) |
Roland McGrath | d83c50b | 2004-10-06 22:27:43 +0000 | [diff] [blame] | 757 | { |
| 758 | switch (code) { |
| 759 | case RTC_ALM_SET: |
| 760 | case RTC_SET_TIME: |
| 761 | if (entering(tcp)) { |
| 762 | struct rtc_time rt; |
| 763 | if (umove(tcp, arg, &rt) < 0) |
| 764 | tprintf(", %#lx", arg); |
| 765 | else { |
Denys Vlasenko | 60fe8c1 | 2011-09-01 10:00:28 +0200 | [diff] [blame] | 766 | tprints(", "); |
Roland McGrath | d83c50b | 2004-10-06 22:27:43 +0000 | [diff] [blame] | 767 | print_rtc(tcp, &rt); |
| 768 | } |
| 769 | } |
| 770 | break; |
| 771 | case RTC_ALM_READ: |
| 772 | case RTC_RD_TIME: |
| 773 | if (exiting(tcp)) { |
| 774 | struct rtc_time rt; |
| 775 | if (syserror(tcp) || umove(tcp, arg, &rt) < 0) |
| 776 | tprintf(", %#lx", arg); |
| 777 | else { |
Denys Vlasenko | 60fe8c1 | 2011-09-01 10:00:28 +0200 | [diff] [blame] | 778 | tprints(", "); |
Roland McGrath | d83c50b | 2004-10-06 22:27:43 +0000 | [diff] [blame] | 779 | print_rtc(tcp, &rt); |
| 780 | } |
| 781 | } |
| 782 | break; |
| 783 | case RTC_IRQP_SET: |
| 784 | case RTC_EPOCH_SET: |
| 785 | if (entering(tcp)) |
| 786 | tprintf(", %lu", arg); |
| 787 | break; |
| 788 | case RTC_IRQP_READ: |
| 789 | case RTC_EPOCH_READ: |
| 790 | if (exiting(tcp)) |
| 791 | tprintf(", %lu", arg); |
| 792 | break; |
| 793 | case RTC_WKALM_SET: |
| 794 | if (entering(tcp)) { |
| 795 | struct rtc_wkalrm wk; |
| 796 | if (umove(tcp, arg, &wk) < 0) |
| 797 | tprintf(", %#lx", arg); |
| 798 | else { |
| 799 | tprintf(", {enabled=%d, pending=%d, ", |
| 800 | wk.enabled, wk.pending); |
| 801 | print_rtc(tcp, &wk.time); |
Denys Vlasenko | 60fe8c1 | 2011-09-01 10:00:28 +0200 | [diff] [blame] | 802 | tprints("}"); |
Roland McGrath | d83c50b | 2004-10-06 22:27:43 +0000 | [diff] [blame] | 803 | } |
| 804 | } |
| 805 | break; |
| 806 | case RTC_WKALM_RD: |
| 807 | if (exiting(tcp)) { |
| 808 | struct rtc_wkalrm wk; |
| 809 | if (syserror(tcp) || umove(tcp, arg, &wk) < 0) |
| 810 | tprintf(", %#lx", arg); |
| 811 | else { |
| 812 | tprintf(", {enabled=%d, pending=%d, ", |
| 813 | wk.enabled, wk.pending); |
| 814 | print_rtc(tcp, &wk.time); |
Denys Vlasenko | 60fe8c1 | 2011-09-01 10:00:28 +0200 | [diff] [blame] | 815 | tprints("}"); |
Roland McGrath | d83c50b | 2004-10-06 22:27:43 +0000 | [diff] [blame] | 816 | } |
| 817 | } |
| 818 | break; |
| 819 | default: |
| 820 | if (entering(tcp)) |
| 821 | tprintf(", %#lx", arg); |
| 822 | break; |
| 823 | } |
| 824 | return 1; |
| 825 | } |
Roland McGrath | e466234 | 2007-08-02 01:25:34 +0000 | [diff] [blame] | 826 | |
| 827 | #ifndef TFD_TIMER_ABSTIME |
| 828 | #define TFD_TIMER_ABSTIME (1 << 0) |
| 829 | #endif |
| 830 | |
Dmitry V. Levin | 0ed617b | 2014-04-25 23:30:54 +0000 | [diff] [blame] | 831 | #include "xlat/timerfdflags.h" |
Roland McGrath | e466234 | 2007-08-02 01:25:34 +0000 | [diff] [blame] | 832 | |
| 833 | int |
Denys Vlasenko | 1201426 | 2011-05-30 14:00:14 +0200 | [diff] [blame] | 834 | sys_timerfd(struct tcb *tcp) |
Roland McGrath | e466234 | 2007-08-02 01:25:34 +0000 | [diff] [blame] | 835 | { |
| 836 | if (entering(tcp)) { |
| 837 | /* It does not matter that the kernel uses itimerspec. */ |
| 838 | tprintf("%ld, ", tcp->u_arg[0]); |
Stefan Sørensen | a5fea90 | 2014-02-03 10:01:27 +0100 | [diff] [blame] | 839 | printclockname(tcp->u_arg[0]); |
Denys Vlasenko | 60fe8c1 | 2011-09-01 10:00:28 +0200 | [diff] [blame] | 840 | tprints(", "); |
Roland McGrath | e466234 | 2007-08-02 01:25:34 +0000 | [diff] [blame] | 841 | printflags(timerfdflags, tcp->u_arg[2], "TFD_???"); |
Denys Vlasenko | 60fe8c1 | 2011-09-01 10:00:28 +0200 | [diff] [blame] | 842 | tprints(", "); |
Roland McGrath | e466234 | 2007-08-02 01:25:34 +0000 | [diff] [blame] | 843 | printitv(tcp, tcp->u_arg[3]); |
| 844 | } |
| 845 | return 0; |
| 846 | } |
Roland McGrath | de328e6 | 2008-05-20 04:56:13 +0000 | [diff] [blame] | 847 | |
| 848 | int |
| 849 | sys_timerfd_create(struct tcb *tcp) |
| 850 | { |
| 851 | if (entering(tcp)) { |
Stefan Sørensen | a5fea90 | 2014-02-03 10:01:27 +0100 | [diff] [blame] | 852 | printclockname(tcp->u_arg[0]); |
Denys Vlasenko | 60fe8c1 | 2011-09-01 10:00:28 +0200 | [diff] [blame] | 853 | tprints(", "); |
Roland McGrath | de328e6 | 2008-05-20 04:56:13 +0000 | [diff] [blame] | 854 | printflags(timerfdflags, tcp->u_arg[1], "TFD_???"); |
| 855 | } |
| 856 | return 0; |
| 857 | } |
| 858 | |
| 859 | int |
| 860 | sys_timerfd_settime(struct tcb *tcp) |
| 861 | { |
| 862 | if (entering(tcp)) { |
Dmitry V. Levin | 3138213 | 2011-03-04 05:08:02 +0300 | [diff] [blame] | 863 | printfd(tcp, tcp->u_arg[0]); |
Denys Vlasenko | 60fe8c1 | 2011-09-01 10:00:28 +0200 | [diff] [blame] | 864 | tprints(", "); |
Roland McGrath | de328e6 | 2008-05-20 04:56:13 +0000 | [diff] [blame] | 865 | printflags(timerfdflags, tcp->u_arg[1], "TFD_???"); |
Denys Vlasenko | 60fe8c1 | 2011-09-01 10:00:28 +0200 | [diff] [blame] | 866 | tprints(", "); |
Roland McGrath | de328e6 | 2008-05-20 04:56:13 +0000 | [diff] [blame] | 867 | printitv(tcp, tcp->u_arg[2]); |
Denys Vlasenko | 60fe8c1 | 2011-09-01 10:00:28 +0200 | [diff] [blame] | 868 | tprints(", "); |
Roland McGrath | de328e6 | 2008-05-20 04:56:13 +0000 | [diff] [blame] | 869 | printitv(tcp, tcp->u_arg[3]); |
| 870 | } |
| 871 | return 0; |
| 872 | } |
| 873 | |
| 874 | int |
| 875 | sys_timerfd_gettime(struct tcb *tcp) |
| 876 | { |
| 877 | if (entering(tcp)) { |
Dmitry V. Levin | 3138213 | 2011-03-04 05:08:02 +0300 | [diff] [blame] | 878 | printfd(tcp, tcp->u_arg[0]); |
Denys Vlasenko | 60fe8c1 | 2011-09-01 10:00:28 +0200 | [diff] [blame] | 879 | tprints(", "); |
Roland McGrath | de328e6 | 2008-05-20 04:56:13 +0000 | [diff] [blame] | 880 | printitv(tcp, tcp->u_arg[1]); |
| 881 | } |
| 882 | return 0; |
| 883 | } |