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.

eventfd.c 670B

12345678910111213141516171819202122232425262728293031323334353637
  1. /*
  2. * Copyright (c) 2007 Ulrich Drepper <drepper@redhat.com>
  3. * Copyright (c) 2008-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 <fcntl.h>
  10. #ifdef HAVE_SYS_EVENTFD_H
  11. # include <sys/eventfd.h>
  12. #endif
  13. #include "xlat/efd_flags.h"
  14. static int
  15. do_eventfd(struct tcb *tcp, int flags_arg)
  16. {
  17. tprintf("%u", (unsigned int) tcp->u_arg[0]);
  18. if (flags_arg >= 0) {
  19. tprints(", ");
  20. printflags(efd_flags, tcp->u_arg[flags_arg], "EFD_???");
  21. }
  22. return RVAL_DECODED | RVAL_FD;
  23. }
  24. SYS_FUNC(eventfd)
  25. {
  26. return do_eventfd(tcp, -1);
  27. }
  28. SYS_FUNC(eventfd2)
  29. {
  30. return do_eventfd(tcp, 1);
  31. }