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.

access.c 554B

12345678910111213141516171819202122232425262728293031323334
  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. #include <fcntl.h>
  9. #include "xlat/access_flags.h"
  10. static int
  11. decode_access(struct tcb *tcp, int offset)
  12. {
  13. printpath(tcp, tcp->u_arg[offset]);
  14. tprints(", ");
  15. printflags(access_flags, tcp->u_arg[offset + 1], "?_OK");
  16. return RVAL_DECODED;
  17. }
  18. SYS_FUNC(access)
  19. {
  20. return decode_access(tcp, 0);
  21. }
  22. SYS_FUNC(faccessat)
  23. {
  24. print_dirfd(tcp, tcp->u_arg[0]);
  25. tprints(", ");
  26. return decode_access(tcp, 1);
  27. }