]> granicus.if.org Git - strace/blob - signal.c
Add PAF_ARRAY_TRUNCATED flag for print_array_ex
[strace] / signal.c
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  * Copyright (c) 1996-1999 Wichert Akkerman <wichert@cistron.nl>
6  * Copyright (c) 1999 IBM Deutschland Entwicklung GmbH, IBM Corporation
7  *                     Linux for s390 port by D.J. Barrow
8  *                    <barrow_dj@mail.yahoo.com,djbarrow@de.ibm.com>
9  * Copyright (c) 2001-2019 The strace developers.
10  * All rights reserved.
11  *
12  * SPDX-License-Identifier: LGPL-2.1-or-later
13  */
14
15 #include "defs.h"
16 #include "nsig.h"
17 #include "xstring.h"
18
19 /* The libc headers do not define this constant since it should only be
20    used by the implementation.  So we define it here.  */
21 #ifndef SA_RESTORER
22 # ifdef ASM_SA_RESTORER
23 #  define SA_RESTORER ASM_SA_RESTORER
24 # endif
25 #endif
26
27 /*
28  * Some architectures define SA_RESTORER in their headers,
29  * but do not actually have sa_restorer.
30  *
31  * Some architectures, otherwise, do not define SA_RESTORER in their headers,
32  * but actually have sa_restorer.
33  */
34 #ifdef HAVE_ARCH_SA_RESTORER
35 # define HAVE_SA_RESTORER HAVE_ARCH_SA_RESTORER
36 #else /* !HAVE_ARCH_SA_RESTORER */
37 # ifdef SA_RESTORER
38 #  define HAVE_SA_RESTORER 1
39 # else
40 #  define HAVE_SA_RESTORER 0
41 # endif
42 #endif /* HAVE_ARCH_SA_RESTORER */
43
44 #include "xlat/sa_handler_values.h"
45 #include "xlat/sigact_flags.h"
46 #include "xlat/sigprocmaskcmds.h"
47
48 /* Anonymous realtime signals. */
49 #ifndef ASM_SIGRTMIN
50 /* Linux kernel >= 3.18 defines SIGRTMIN to 32 on all architectures. */
51 # define ASM_SIGRTMIN 32
52 #endif
53 #ifndef ASM_SIGRTMAX
54 /* Under glibc 2.1, SIGRTMAX et al are functions, but __SIGRTMAX is a
55    constant.  This is what we want.  Otherwise, just use SIGRTMAX. */
56 # ifdef SIGRTMAX
57 #  ifndef __SIGRTMAX
58 #   define __SIGRTMAX SIGRTMAX
59 #  endif
60 # endif
61 # ifdef __SIGRTMAX
62 #  define ASM_SIGRTMAX __SIGRTMAX
63 # endif
64 #endif
65
66 /* Note on the size of sigset_t:
67  *
68  * In glibc, sigset_t is an array with space for 1024 bits (!),
69  * even though all arches supported by Linux have only 64 signals
70  * except MIPS, which has 128. IOW, it is 128 bytes long.
71  *
72  * In-kernel sigset_t is sized correctly (it is either 64 or 128 bit long).
73  * However, some old syscall return only 32 lower bits (one word).
74  * Example: sys_sigpending vs sys_rt_sigpending.
75  *
76  * Be aware of this fact when you try to
77  *     memcpy(&tcp->u_arg[1], &something, sizeof(sigset_t))
78  * - sizeof(sigset_t) is much bigger than you think,
79  * it may overflow tcp->u_arg[] array, and it may try to copy more data
80  * than is really available in <something>.
81  * Similarly,
82  *     umoven(tcp, addr, sizeof(sigset_t), &sigset)
83  * may be a bad idea: it'll try to read much more data than needed
84  * to fetch a sigset_t.
85  * Use NSIG_BYTES as a size instead.
86  */
87
88 static const char *
89 get_sa_handler_str(kernel_ulong_t handler)
90 {
91         return xlookup(sa_handler_values, handler);
92 }
93
94 static void
95 print_sa_handler(kernel_ulong_t handler)
96 {
97         const char *sa_handler_str = get_sa_handler_str(handler);
98
99         if (sa_handler_str)
100                 print_xlat_ex(handler, sa_handler_str, XLAT_STYLE_DEFAULT);
101         else
102                 printaddr(handler);
103 }
104
105 const char *
106 signame(const int sig)
107 {
108         if (sig > 0) {
109                 const unsigned int s = sig;
110
111                 if (s < nsignals)
112                         return signalent[s];
113 #ifdef ASM_SIGRTMAX
114                 if (s >= ASM_SIGRTMIN && s <= (unsigned int) ASM_SIGRTMAX) {
115                         static char buf[sizeof("SIGRT_%u") + sizeof(s) * 3];
116
117                         xsprintf(buf, "SIGRT_%u", s - ASM_SIGRTMIN);
118                         return buf;
119                 }
120 #endif
121         }
122
123         return NULL;
124 }
125
126 const char *
127 sprintsigname(const int sig)
128 {
129         const char *str = signame(sig);
130
131         if (str)
132                 return str;
133
134         static char buf[sizeof(sig) * 3 + 2];
135
136         xsprintf(buf, "%d", sig);
137
138         return buf;
139 }
140
141 const char *
142 sprintsigmask_n(const char *prefix, const void *sig_mask, unsigned int bytes)
143 {
144         /*
145          * The maximum number of signal names to be printed
146          * is NSIG_BYTES * 8 * 2 / 3.
147          * Most of signal names have length 7,
148          * average length of signal names is less than 7.
149          * The length of prefix string does not exceed 16.
150          */
151         static char outstr[128 + 8 * (NSIG_BYTES * 8 * 2 / 3)];
152
153         char *s;
154         const uint32_t *mask;
155         uint32_t inverted_mask[NSIG_BYTES / 4];
156         unsigned int size;
157         int i;
158         char sep;
159
160         s = stpcpy(outstr, prefix);
161
162         mask = sig_mask;
163         /* length of signal mask in 4-byte words */
164         size = (bytes >= NSIG_BYTES) ? NSIG_BYTES / 4 : (bytes + 3) / 4;
165
166         /* check whether 2/3 or more bits are set */
167         if (popcount32(mask, size) >= size * (4 * 8) * 2 / 3) {
168                 /* show those signals that are NOT in the mask */
169                 unsigned int j;
170                 for (j = 0; j < size; ++j)
171                         inverted_mask[j] = ~mask[j];
172                 mask = inverted_mask;
173                 *s++ = '~';
174         }
175
176         sep = '[';
177         for (i = 0; (i = next_set_bit(mask, i, size * (4 * 8))) >= 0; ) {
178                 ++i;
179                 *s++ = sep;
180                 if ((unsigned) i < nsignals) {
181                         s = stpcpy(s, signalent[i] + 3);
182                 }
183 #ifdef ASM_SIGRTMAX
184                 else if (i >= ASM_SIGRTMIN && i <= ASM_SIGRTMAX) {
185                         s = xappendstr(outstr, s, "RT_%u", i - ASM_SIGRTMIN);
186                 }
187 #endif
188                 else {
189                         s = xappendstr(outstr, s, "%u", i);
190                 }
191                 sep = ' ';
192         }
193         if (sep == '[')
194                 *s++ = sep;
195         *s++ = ']';
196         *s = '\0';
197         return outstr;
198 }
199
200 #define sprintsigmask_val(prefix, mask) \
201         sprintsigmask_n((prefix), &(mask), sizeof(mask))
202
203 #define tprintsigmask_val(prefix, mask) \
204         tprints(sprintsigmask_n((prefix), &(mask), sizeof(mask)))
205
206 static const char *
207 sprint_old_sigmask_val(const char *const prefix, const unsigned long mask)
208 {
209 #if defined(current_wordsize) || !defined(WORDS_BIGENDIAN)
210         return sprintsigmask_n(prefix, &mask, current_wordsize);
211 #else /* !current_wordsize && WORDS_BIGENDIAN */
212         if (current_wordsize == sizeof(mask)) {
213                 return sprintsigmask_val(prefix, mask);
214         } else {
215                 uint32_t mask32 = mask;
216                 return sprintsigmask_val(prefix, mask32);
217         }
218 #endif
219 }
220
221 #define tprint_old_sigmask_val(prefix, mask) \
222         tprints(sprint_old_sigmask_val((prefix), (mask)))
223
224 void
225 printsignal(int nr)
226 {
227         const char *str = signame(nr);
228
229         if (!str || xlat_verbose(xlat_verbosity) != XLAT_STYLE_ABBREV)
230                 tprintf("%d", nr);
231         if (!str || xlat_verbose(xlat_verbosity) == XLAT_STYLE_RAW)
232                 return;
233         (xlat_verbose(xlat_verbosity) == XLAT_STYLE_VERBOSE
234                 ? tprints_comment : tprints)(str);
235 }
236
237 static void
238 print_sigset_addr_len_limit(struct tcb *const tcp, const kernel_ulong_t addr,
239                             const kernel_ulong_t len, const unsigned int min_len)
240 {
241         /*
242          * Here len is usually equal to NSIG_BYTES or current_wordsize.
243          * But we code this defensively:
244          */
245         if (len < min_len || len > NSIG_BYTES) {
246                 printaddr(addr);
247                 return;
248         }
249         int mask[NSIG_BYTES / sizeof(int)] = {};
250         if (umoven_or_printaddr(tcp, addr, len, mask))
251                 return;
252         tprints(sprintsigmask_n("", mask, len));
253 }
254
255 void
256 print_sigset_addr_len(struct tcb *const tcp, const kernel_ulong_t addr,
257                       const kernel_ulong_t len)
258 {
259         print_sigset_addr_len_limit(tcp, addr, len, current_wordsize);
260 }
261
262 void
263 print_sigset_addr(struct tcb *const tcp, const kernel_ulong_t addr)
264 {
265         print_sigset_addr_len_limit(tcp, addr, NSIG_BYTES, NSIG_BYTES);
266 }
267
268 SYS_FUNC(ssetmask)
269 {
270         if (entering(tcp)) {
271                 tprint_old_sigmask_val("", (unsigned) tcp->u_arg[0]);
272         } else if (!syserror(tcp)) {
273                 tcp->auxstr = sprint_old_sigmask_val("old mask ",
274                                                      (unsigned) tcp->u_rval);
275                 return RVAL_HEX | RVAL_STR;
276         }
277         return 0;
278 }
279
280 struct old_sigaction {
281         /* sa_handler may be a libc #define, need to use other name: */
282 #if defined MIPS
283         unsigned int sa_flags;
284         unsigned long sa_handler__;
285         unsigned long sa_mask;
286 #elif defined ALPHA
287         unsigned long sa_handler__;
288         unsigned long sa_mask;
289         unsigned int sa_flags;
290 #else
291         unsigned long sa_handler__;
292         unsigned long sa_mask;
293         unsigned long sa_flags;
294         unsigned long sa_restorer;
295 #endif
296 }
297 #ifdef ALPHA
298         ATTRIBUTE_PACKED
299 #endif
300 ;
301
302 static void
303 decode_old_sigaction(struct tcb *const tcp, const kernel_ulong_t addr)
304 {
305         struct old_sigaction sa;
306
307 #ifndef current_wordsize
308         if (current_wordsize < sizeof(sa.sa_handler__)) {
309                 struct old_sigaction32 {
310                         uint32_t sa_handler__;
311                         uint32_t sa_mask;
312                         uint32_t sa_flags;
313                         uint32_t sa_restorer;
314                 } sa32;
315
316                 if (umove_or_printaddr(tcp, addr, &sa32))
317                         return;
318
319                 memset(&sa, 0, sizeof(sa));
320                 sa.sa_handler__ = sa32.sa_handler__;
321                 sa.sa_flags = sa32.sa_flags;
322                 sa.sa_restorer = sa32.sa_restorer;
323                 sa.sa_mask = sa32.sa_mask;
324         } else
325 #endif
326         if (umove_or_printaddr(tcp, addr, &sa))
327                 return;
328
329         tprints("{sa_handler=");
330         print_sa_handler(sa.sa_handler__);
331         tprints(", sa_mask=");
332         tprint_old_sigmask_val("", sa.sa_mask);
333         tprints(", sa_flags=");
334         printflags(sigact_flags, sa.sa_flags, "SA_???");
335 #if !(defined ALPHA || defined MIPS)
336         if (sa.sa_flags & 0x04000000U) {
337                 tprints(", sa_restorer=");
338                 printaddr(sa.sa_restorer);
339         }
340 #endif
341         tprints("}");
342 }
343
344 SYS_FUNC(sigaction)
345 {
346         if (entering(tcp)) {
347                 int signo = tcp->u_arg[0];
348 #if defined SPARC || defined SPARC64
349                 if (signo < 0) {
350                         tprints("-");
351                         signo = -signo;
352                 }
353 #endif
354                 printsignal(signo);
355                 tprints(", ");
356                 decode_old_sigaction(tcp, tcp->u_arg[1]);
357                 tprints(", ");
358         } else
359                 decode_old_sigaction(tcp, tcp->u_arg[2]);
360         return 0;
361 }
362
363 SYS_FUNC(signal)
364 {
365         if (entering(tcp)) {
366                 printsignal(tcp->u_arg[0]);
367                 tprints(", ");
368                 print_sa_handler(tcp->u_arg[1]);
369                 return 0;
370         } else if (!syserror(tcp)) {
371                 tcp->auxstr = get_sa_handler_str(tcp->u_rval);
372                 return RVAL_HEX | RVAL_STR;
373         }
374         return 0;
375 }
376
377 SYS_FUNC(sgetmask)
378 {
379         if (exiting(tcp) && !syserror(tcp)) {
380                 tcp->auxstr = sprint_old_sigmask_val("mask ", tcp->u_rval);
381                 return RVAL_HEX | RVAL_STR;
382         }
383         return 0;
384 }
385
386 SYS_FUNC(sigsuspend)
387 {
388 #ifdef MIPS
389         print_sigset_addr_len(tcp, tcp->u_arg[n_args(tcp) - 1],
390                               current_wordsize);
391 #else
392         tprint_old_sigmask_val("", tcp->u_arg[n_args(tcp) - 1]);
393 #endif
394
395         return RVAL_DECODED;
396 }
397
398 #ifdef ALPHA
399 /*
400  * The OSF/1 sigprocmask is different: it doesn't pass in two pointers,
401  * but rather passes in the new bitmask as an argument and then returns
402  * the old bitmask.  This "works" because we only have 64 signals to worry
403  * about.  If you want more, use of the rt_sigprocmask syscall is required.
404  *
405  * Alpha:
406  *      old = osf_sigprocmask(how, new);
407  * Everyone else:
408  *      ret = sigprocmask(how, &new, &old, ...);
409  */
410 SYS_FUNC(osf_sigprocmask)
411 {
412         if (entering(tcp)) {
413                 printxval(sigprocmaskcmds, tcp->u_arg[0], "SIG_???");
414                 tprintsigmask_val(", ", tcp->u_arg[1]);
415         } else if (!syserror(tcp)) {
416                 tcp->auxstr = sprintsigmask_val("old mask ", tcp->u_rval);
417                 return RVAL_HEX | RVAL_STR;
418         }
419         return 0;
420 }
421
422 #else /* !ALPHA */
423
424 /* "Old" sigprocmask, which operates with word-sized signal masks */
425 SYS_FUNC(sigprocmask)
426 {
427         if (entering(tcp)) {
428                 printxval(sigprocmaskcmds, tcp->u_arg[0], "SIG_???");
429                 tprints(", ");
430                 print_sigset_addr_len(tcp, tcp->u_arg[1], current_wordsize);
431                 tprints(", ");
432         } else {
433                 print_sigset_addr_len(tcp, tcp->u_arg[2], current_wordsize);
434         }
435         return 0;
436 }
437 #endif /* !ALPHA */
438
439 SYS_FUNC(kill)
440 {
441         /* pid */
442         tprintf("%d, ", (int) tcp->u_arg[0]);
443         /* signal */
444         printsignal(tcp->u_arg[1]);
445
446         return RVAL_DECODED;
447 }
448
449 SYS_FUNC(tgkill)
450 {
451         /* tgid, tid */
452         tprintf("%d, %d, ", (int) tcp->u_arg[0], (int) tcp->u_arg[1]);
453         /* signal */
454         printsignal(tcp->u_arg[2]);
455
456         return RVAL_DECODED;
457 }
458
459 SYS_FUNC(sigpending)
460 {
461         if (exiting(tcp))
462                 print_sigset_addr_len(tcp, tcp->u_arg[0], current_wordsize);
463         return 0;
464 }
465
466 SYS_FUNC(rt_sigprocmask)
467 {
468         /* Note: arg[3] is the length of the sigset. Kernel requires NSIG_BYTES */
469         if (entering(tcp)) {
470                 printxval(sigprocmaskcmds, tcp->u_arg[0], "SIG_???");
471                 tprints(", ");
472                 print_sigset_addr_len(tcp, tcp->u_arg[1], tcp->u_arg[3]);
473                 tprints(", ");
474         } else {
475                 print_sigset_addr_len(tcp, tcp->u_arg[2], tcp->u_arg[3]);
476                 tprintf(", %" PRI_klu, tcp->u_arg[3]);
477         }
478         return 0;
479 }
480
481 /* Structure describing the action to be taken when a signal arrives.  */
482 struct new_sigaction {
483         /* sa_handler may be a libc #define, need to use other name: */
484 #ifdef MIPS
485         unsigned int sa_flags;
486         unsigned long sa_handler__;
487 #else
488         unsigned long sa_handler__;
489         unsigned long sa_flags;
490 #endif /* !MIPS */
491 #if HAVE_SA_RESTORER
492         unsigned long sa_restorer;
493 #endif
494         /* Kernel treats sa_mask as an array of longs. */
495         unsigned long sa_mask[NSIG / sizeof(long)];
496 };
497 /* Same for i386-on-x86_64 and similar cases */
498 struct new_sigaction32 {
499         uint32_t sa_handler__;
500         uint32_t sa_flags;
501 #if HAVE_SA_RESTORER
502         uint32_t sa_restorer;
503 #endif
504         uint32_t sa_mask[2 * (NSIG / sizeof(long))];
505 };
506
507 static void
508 decode_new_sigaction(struct tcb *const tcp, const kernel_ulong_t addr)
509 {
510         struct new_sigaction sa;
511
512 #ifndef current_wordsize
513         if (current_wordsize < sizeof(sa.sa_handler__)) {
514                 struct new_sigaction32 sa32;
515
516                 if (umove_or_printaddr(tcp, addr, &sa32))
517                         return;
518
519                 memset(&sa, 0, sizeof(sa));
520                 sa.sa_handler__ = sa32.sa_handler__;
521                 sa.sa_flags     = sa32.sa_flags;
522 # if HAVE_SA_RESTORER && defined SA_RESTORER
523                 sa.sa_restorer  = sa32.sa_restorer;
524 # endif
525                 /* Kernel treats sa_mask as an array of longs.
526                  * For 32-bit process, "long" is uint32_t, thus, for example,
527                  * 32th bit in sa_mask will end up as bit 0 in sa_mask[1].
528                  * But for (64-bit) kernel, 32th bit in sa_mask is
529                  * 32th bit in 0th (64-bit) long!
530                  * For little-endian, it's the same.
531                  * For big-endian, we swap 32-bit words.
532                  */
533                 sa.sa_mask[0] = ULONG_LONG(sa32.sa_mask[0], sa32.sa_mask[1]);
534         } else
535 #endif
536         if (umove_or_printaddr(tcp, addr, &sa))
537                 return;
538
539         tprints("{sa_handler=");
540         print_sa_handler(sa.sa_handler__);
541         tprints(", sa_mask=");
542         /*
543          * Sigset size is in tcp->u_arg[4] (SPARC)
544          * or in tcp->u_arg[3] (all other),
545          * but kernel won't handle sys_rt_sigaction
546          * with wrong sigset size (just returns EINVAL instead).
547          * We just fetch the right size, which is NSIG_BYTES.
548          */
549         tprintsigmask_val("", sa.sa_mask);
550         tprints(", sa_flags=");
551
552         printflags(sigact_flags, sa.sa_flags, "SA_???");
553 #if HAVE_SA_RESTORER && defined SA_RESTORER
554         if (sa.sa_flags & SA_RESTORER) {
555                 tprints(", sa_restorer=");
556                 printaddr(sa.sa_restorer);
557         }
558 #endif
559         tprints("}");
560 }
561
562 SYS_FUNC(rt_sigaction)
563 {
564         if (entering(tcp)) {
565                 printsignal(tcp->u_arg[0]);
566                 tprints(", ");
567                 decode_new_sigaction(tcp, tcp->u_arg[1]);
568                 tprints(", ");
569         } else {
570                 decode_new_sigaction(tcp, tcp->u_arg[2]);
571 #if defined(SPARC) || defined(SPARC64)
572                 tprintf(", %#" PRI_klx ", %" PRI_klu, tcp->u_arg[3], tcp->u_arg[4]);
573 #elif defined(ALPHA)
574                 tprintf(", %" PRI_klu ", %#" PRI_klx, tcp->u_arg[3], tcp->u_arg[4]);
575 #else
576                 tprintf(", %" PRI_klu, tcp->u_arg[3]);
577 #endif
578         }
579         return 0;
580 }
581
582 SYS_FUNC(rt_sigpending)
583 {
584         if (exiting(tcp)) {
585                 /*
586                  * One of the few syscalls where sigset size (arg[1])
587                  * is allowed to be <= NSIG_BYTES, not strictly ==.
588                  * This allows non-rt sigpending() syscall
589                  * to reuse rt_sigpending() code in kernel.
590                  */
591                 print_sigset_addr_len_limit(tcp, tcp->u_arg[0],
592                                             tcp->u_arg[1], 1);
593                 tprintf(", %" PRI_klu, tcp->u_arg[1]);
594         }
595         return 0;
596 }
597
598 SYS_FUNC(rt_sigsuspend)
599 {
600         /* NB: kernel requires arg[1] == NSIG_BYTES */
601         print_sigset_addr_len(tcp, tcp->u_arg[0], tcp->u_arg[1]);
602         tprintf(", %" PRI_klu, tcp->u_arg[1]);
603
604         return RVAL_DECODED;
605 }
606
607 static void
608 print_sigqueueinfo(struct tcb *const tcp, const int sig,
609                    const kernel_ulong_t addr)
610 {
611         printsignal(sig);
612         tprints(", ");
613         printsiginfo_at(tcp, addr);
614 }
615
616 SYS_FUNC(rt_sigqueueinfo)
617 {
618         tprintf("%d, ", (int) tcp->u_arg[0]);
619         print_sigqueueinfo(tcp, tcp->u_arg[1], tcp->u_arg[2]);
620
621         return RVAL_DECODED;
622 }
623
624 SYS_FUNC(rt_tgsigqueueinfo)
625 {
626         tprintf("%d, %d, ", (int) tcp->u_arg[0], (int) tcp->u_arg[1]);
627         print_sigqueueinfo(tcp, tcp->u_arg[2], tcp->u_arg[3]);
628
629         return RVAL_DECODED;
630 }
631
632 SYS_FUNC(pidfd_send_signal)
633 {
634         /* int pidfd */
635         printfd(tcp, tcp->u_arg[0]);
636         /* int sig, siginfo_t *info */
637         tprints(", ");
638         print_sigqueueinfo(tcp, tcp->u_arg[1], tcp->u_arg[2]);
639         /* unsigned int flags */
640         tprintf(", %#x", (unsigned int) tcp->u_arg[3]);
641
642         return RVAL_DECODED;
643 }
644
645 static int
646 do_rt_sigtimedwait(struct tcb *const tcp, const print_obj_by_addr_fn print_ts,
647                    const sprint_obj_by_addr_fn sprint_ts)
648 {
649         /* NB: kernel requires arg[3] == NSIG_BYTES */
650         if (entering(tcp)) {
651                 print_sigset_addr_len(tcp, tcp->u_arg[0], tcp->u_arg[3]);
652                 tprints(", ");
653                 if (!(tcp->u_arg[1] && verbose(tcp))) {
654                         /*
655                          * This is the only "return" parameter,
656                          * if we are not going to fetch it on exit,
657                          * decode all parameters on entry.
658                          */
659                         printaddr(tcp->u_arg[1]);
660                         tprints(", ");
661                         print_ts(tcp, tcp->u_arg[2]);
662                         tprintf(", %" PRI_klu, tcp->u_arg[3]);
663                 } else {
664                         char *sts = xstrdup(sprint_ts(tcp, tcp->u_arg[2]));
665                         set_tcb_priv_data(tcp, sts, free);
666                 }
667         } else {
668                 if (tcp->u_arg[1] && verbose(tcp)) {
669                         printsiginfo_at(tcp, tcp->u_arg[1]);
670                         tprints(", ");
671                         tprints(get_tcb_priv_data(tcp));
672                         tprintf(", %" PRI_klu, tcp->u_arg[3]);
673                 }
674
675                 if (!syserror(tcp) && tcp->u_rval) {
676                         tcp->auxstr = signame(tcp->u_rval);
677                         return RVAL_STR;
678                 }
679         }
680         return 0;
681 }
682
683 #if HAVE_ARCH_TIME32_SYSCALLS
684 SYS_FUNC(rt_sigtimedwait_time32)
685 {
686         return do_rt_sigtimedwait(tcp, print_timespec32, sprint_timespec32);
687 }
688 #endif
689
690 SYS_FUNC(rt_sigtimedwait_time64)
691 {
692         return do_rt_sigtimedwait(tcp, print_timespec64, sprint_timespec64);
693 }
694
695 SYS_FUNC(restart_syscall)
696 {
697         tprintf("<... resuming interrupted %s ...>",
698                 tcp->s_prev_ent ? tcp->s_prev_ent->sys_name : "system call");
699
700         return RVAL_DECODED;
701 }