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.

chmod.c 632B

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. /*
  2. * Copyright (c) 2014-2019 The strace developers.
  3. * All rights reserved.
  4. *
  5. * SPDX-License-Identifier: LGPL-2.1-or-later
  6. */
  7. #include "defs.h"
  8. static void
  9. decode_chmod(struct tcb *tcp, const int offset)
  10. {
  11. printpath(tcp, tcp->u_arg[offset]);
  12. tprints(", ");
  13. print_numeric_umode_t(tcp->u_arg[offset + 1]);
  14. }
  15. SYS_FUNC(chmod)
  16. {
  17. decode_chmod(tcp, 0);
  18. return RVAL_DECODED;
  19. }
  20. SYS_FUNC(fchmodat)
  21. {
  22. print_dirfd(tcp, tcp->u_arg[0]);
  23. tprints(", ");
  24. decode_chmod(tcp, 1);
  25. return RVAL_DECODED;
  26. }
  27. SYS_FUNC(fchmod)
  28. {
  29. printfd(tcp, tcp->u_arg[0]);
  30. tprints(", ");
  31. print_numeric_umode_t(tcp->u_arg[1]);
  32. return RVAL_DECODED;
  33. }