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_msgbuf.c 1002B

123456789101112131415161718192021222324252627282930313233
  1. /*
  2. * Copyright (c) 1993 Ulrich Pegelow <pegelow@moorea.uni-muenster.de>
  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) 2003-2006 Roland McGrath <roland@redhat.com>
  7. * Copyright (c) 2006-2015 Dmitry V. Levin <ldv@altlinux.org>
  8. * Copyright (c) 2015-2018 The strace developers.
  9. * All rights reserved.
  10. *
  11. * SPDX-License-Identifier: LGPL-2.1-or-later
  12. */
  13. #include "defs.h"
  14. #include <sys/msg.h>
  15. #include DEF_MPERS_TYPE(msgbuf_t)
  16. typedef struct msgbuf msgbuf_t;
  17. #include MPERS_DEFS
  18. MPERS_PRINTER_DECL(void, tprint_msgbuf, struct tcb *const tcp,
  19. const kernel_ulong_t addr, const kernel_ulong_t count)
  20. {
  21. msgbuf_t msg;
  22. if (!umove_or_printaddr(tcp, addr, &msg)) {
  23. tprintf("{%" PRI_kld ", ", (kernel_long_t) msg.mtype);
  24. printstrn(tcp, addr + sizeof(msg.mtype), count);
  25. tprints("}");
  26. }
  27. tprintf(", %" PRI_klu ", ", count);
  28. }