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.

utimes.c 1.6KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. /*
  2. * Copyright (c) 1991, 1992 Paul Kranenburg <pk@cs.few.eur.nl>
  3. * Copyright (c) 1993 Branko Lankester <branko@hacktic.nl>
  4. * Copyright (c) 1993-1996 Rick Sladkey <jrs@world.std.com>
  5. * Copyright (c) 1996-1999 Wichert Akkerman <wichert@cistron.nl>
  6. * Copyright (c) 2006-2007 Ulrich Drepper <drepper@redhat.com>
  7. * Copyright (c) 2006 Bernhard Kaindl <bk@suse.de>
  8. * Copyright (c) 2006-2015 Dmitry V. Levin <ldv@altlinux.org>
  9. * Copyright (c) 2014-2019 The strace developers.
  10. * All rights reserved.
  11. *
  12. * SPDX-License-Identifier: LGPL-2.1-or-later
  13. */
  14. #include "defs.h"
  15. SYS_FUNC(utimes)
  16. {
  17. printpath(tcp, tcp->u_arg[0]);
  18. tprints(", ");
  19. print_timeval_utimes(tcp, tcp->u_arg[1]);
  20. return RVAL_DECODED;
  21. }
  22. SYS_FUNC(futimesat)
  23. {
  24. print_dirfd(tcp, tcp->u_arg[0]);
  25. tprints(", ");
  26. printpath(tcp, tcp->u_arg[1]);
  27. tprints(", ");
  28. print_timeval_utimes(tcp, tcp->u_arg[2]);
  29. return RVAL_DECODED;
  30. }
  31. static int
  32. do_utimensat(struct tcb *const tcp, const print_obj_by_addr_fn print_ts)
  33. {
  34. print_dirfd(tcp, tcp->u_arg[0]);
  35. tprints(", ");
  36. printpath(tcp, tcp->u_arg[1]);
  37. tprints(", ");
  38. print_ts(tcp, tcp->u_arg[2]);
  39. tprints(", ");
  40. printflags(at_flags, tcp->u_arg[3], "AT_???");
  41. return RVAL_DECODED;
  42. }
  43. #if HAVE_ARCH_TIME32_SYSCALLS
  44. SYS_FUNC(utimensat_time32)
  45. {
  46. return do_utimensat(tcp, print_timespec32_utime_pair);
  47. }
  48. #endif
  49. SYS_FUNC(utimensat_time64)
  50. {
  51. return do_utimensat(tcp, print_timespec64_utime_pair);
  52. }
  53. #ifdef ALPHA
  54. SYS_FUNC(osf_utimes)
  55. {
  56. printpath(tcp, tcp->u_arg[0]);
  57. tprints(", ");
  58. print_timeval32_utimes(tcp, tcp->u_arg[1]);
  59. return RVAL_DECODED;
  60. }
  61. #endif /* ALPHA */