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.

stat64.c 1004B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. /*
  2. * Copyright (c) 2005-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. #include "stat.h"
  10. static void
  11. decode_struct_stat64(struct tcb *const tcp, const kernel_ulong_t addr)
  12. {
  13. struct strace_stat st;
  14. if (fetch_struct_stat64(tcp, addr, &st))
  15. print_struct_stat(tcp, &st);
  16. }
  17. SYS_FUNC(stat64)
  18. {
  19. if (entering(tcp)) {
  20. printpath(tcp, tcp->u_arg[0]);
  21. tprints(", ");
  22. } else {
  23. decode_struct_stat64(tcp, tcp->u_arg[1]);
  24. }
  25. return 0;
  26. }
  27. SYS_FUNC(fstat64)
  28. {
  29. if (entering(tcp)) {
  30. printfd(tcp, tcp->u_arg[0]);
  31. tprints(", ");
  32. } else {
  33. decode_struct_stat64(tcp, tcp->u_arg[1]);
  34. }
  35. return 0;
  36. }
  37. SYS_FUNC(fstatat64)
  38. {
  39. if (entering(tcp)) {
  40. print_dirfd(tcp, tcp->u_arg[0]);
  41. printpath(tcp, tcp->u_arg[1]);
  42. tprints(", ");
  43. } else {
  44. decode_struct_stat64(tcp, tcp->u_arg[2]);
  45. tprints(", ");
  46. printflags(at_flags, tcp->u_arg[3], "AT_???");
  47. }
  48. return 0;
  49. }