Mirror of strace – the linux syscall tracer
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

print_sigevent.c 1.3KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. /*
  2. * Copyright (c) 2003, 2004 Ulrich Drepper <drepper@redhat.com>
  3. * Copyright (c) 2005-2018 Dmitry V. Levin <ldv@altlinux.org>
  4. * All rights reserved.
  5. *
  6. * SPDX-License-Identifier: LGPL-2.1-or-later
  7. */
  8. #include "defs.h"
  9. #include DEF_MPERS_TYPE(struct_sigevent)
  10. #include "sigevent.h"
  11. #include MPERS_DEFS
  12. #include <signal.h>
  13. #include "xlat/sigev_value.h"
  14. MPERS_PRINTER_DECL(void, print_sigevent,
  15. struct tcb *const tcp, const kernel_ulong_t addr)
  16. {
  17. struct_sigevent sev;
  18. if (umove_or_printaddr(tcp, addr, &sev))
  19. return;
  20. tprints("{");
  21. if (sev.sigev_value.sival_ptr) {
  22. tprintf("sigev_value={sival_int=%d, sival_ptr=",
  23. sev.sigev_value.sival_int);
  24. printaddr(sev.sigev_value.sival_ptr);
  25. tprints("}, ");
  26. }
  27. tprints("sigev_signo=");
  28. switch (sev.sigev_notify) {
  29. case SIGEV_SIGNAL:
  30. case SIGEV_THREAD:
  31. case SIGEV_THREAD_ID:
  32. printsignal(sev.sigev_signo);
  33. break;
  34. default:
  35. tprintf("%u", sev.sigev_signo);
  36. }
  37. tprints(", sigev_notify=");
  38. printxval(sigev_value, sev.sigev_notify, "SIGEV_???");
  39. switch (sev.sigev_notify) {
  40. case SIGEV_THREAD_ID:
  41. tprintf(", sigev_notify_thread_id=%d", sev.sigev_un.tid);
  42. break;
  43. case SIGEV_THREAD:
  44. tprints(", sigev_notify_function=");
  45. printaddr(sev.sigev_un.sigev_thread.function);
  46. tprints(", sigev_notify_attributes=");
  47. printaddr(sev.sigev_un.sigev_thread.attribute);
  48. break;
  49. }
  50. tprints("}");
  51. }