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.

sendfile.c 1.1KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. /*
  2. * Copyright (c) 2015 Dmitry V. Levin <ldv@altlinux.org>
  3. * Copyright (c) 2015-2018 The strace developers.
  4. * All rights reserved.
  5. *
  6. * SPDX-License-Identifier: LGPL-2.1-or-later
  7. */
  8. #include "defs.h"
  9. SYS_FUNC(sendfile64)
  10. {
  11. if (entering(tcp)) {
  12. printfd(tcp, tcp->u_arg[0]);
  13. tprints(", ");
  14. printfd(tcp, tcp->u_arg[1]);
  15. tprints(", ");
  16. if (!printnum_int64(tcp, tcp->u_arg[2], "%" PRIu64)) {
  17. tprintf(", %" PRI_klu, tcp->u_arg[3]);
  18. return RVAL_DECODED;
  19. }
  20. } else {
  21. if (!syserror(tcp) && tcp->u_rval) {
  22. tprints(" => ");
  23. printnum_int64(tcp, tcp->u_arg[2], "%" PRIu64);
  24. }
  25. tprintf(", %" PRI_klu, tcp->u_arg[3]);
  26. }
  27. return 0;
  28. }
  29. SYS_FUNC(sendfile)
  30. {
  31. if (entering(tcp)) {
  32. printfd(tcp, tcp->u_arg[0]);
  33. tprints(", ");
  34. printfd(tcp, tcp->u_arg[1]);
  35. tprints(", ");
  36. if (!printnum_ulong(tcp, tcp->u_arg[2])
  37. || !tcp->u_arg[3]) {
  38. tprintf(", %" PRI_klu, tcp->u_arg[3]);
  39. return RVAL_DECODED;
  40. }
  41. } else {
  42. if (!syserror(tcp) && tcp->u_rval) {
  43. tprints(" => ");
  44. printnum_ulong(tcp, tcp->u_arg[2]);
  45. }
  46. tprintf(", %" PRI_klu, tcp->u_arg[3]);
  47. }
  48. return 0;
  49. }