strace/print_sigevent.c
Eugene Syromyatnikov b3f92b39f1 Use printsignal instead of signame
As the former respects xlat styles while the latter doesn't.

* clone.c (SYS_FUNC(clone)): Use printsignal for printing termination
signal in printflags.
* fcntl.c (print_fcntl) <case F_SETSIG>: Use printsignal.
* prctl.c (SYS_FUNC(prctl)) <case PR_GET_PDEATHSIG,
case PR_SET_PDEATHSIG>: Likewise.
* print_sigevent.c (print_sigevent): Likewise.
* s390.c (s390_runtime_instr): Likewise.
* signal.c (SYS_FUNC(kill), SYS_FUNC(tgkill)): Likewise.
2018-12-17 19:19:23 +00:00

61 lines
1.3 KiB
C

/*
* Copyright (c) 2003, 2004 Ulrich Drepper <drepper@redhat.com>
* Copyright (c) 2005-2016 Dmitry V. Levin <ldv@altlinux.org>
* All rights reserved.
*
* SPDX-License-Identifier: LGPL-2.1-or-later
*/
#include "defs.h"
#include DEF_MPERS_TYPE(struct_sigevent)
#include "sigevent.h"
#include MPERS_DEFS
#include <signal.h>
#include "xlat/sigev_value.h"
MPERS_PRINTER_DECL(void, print_sigevent,
struct tcb *const tcp, const kernel_ulong_t addr)
{
struct_sigevent sev;
if (umove_or_printaddr(tcp, addr, &sev))
return;
tprints("{");
if (sev.sigev_value.sival_ptr) {
tprintf("sigev_value={sival_int=%d, sival_ptr=",
sev.sigev_value.sival_int);
printaddr(sev.sigev_value.sival_ptr);
tprints("}, ");
}
tprints("sigev_signo=");
switch (sev.sigev_notify) {
case SIGEV_SIGNAL:
case SIGEV_THREAD:
case SIGEV_THREAD_ID:
printsignal(sev.sigev_signo);
break;
default:
tprintf("%u", sev.sigev_signo);
}
tprints(", sigev_notify=");
printxval(sigev_value, sev.sigev_notify, "SIGEV_???");
switch (sev.sigev_notify) {
case SIGEV_THREAD_ID:
tprintf(", sigev_notify_thread_id=%d", sev.sigev_un.tid);
break;
case SIGEV_THREAD:
tprints(", sigev_notify_function=");
printaddr(sev.sigev_un.sigev_thread.function);
tprints(", sigev_notify_attributes=");
printaddr(sev.sigev_un.sigev_thread.attribute);
break;
}
tprints("}");
}