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.

alpha.c 1.1KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. /*
  2. * Copyright (c) 2016 Dmitry V. Levin <ldv@altlinux.org>
  3. * Copyright (c) 2016-2018 The strace developers.
  4. * All rights reserved.
  5. *
  6. * SPDX-License-Identifier: LGPL-2.1-or-later
  7. */
  8. #include "defs.h"
  9. #ifdef ALPHA
  10. # include "xstring.h"
  11. static int
  12. decode_getxxid(struct tcb *tcp, const char *what)
  13. {
  14. if (entering(tcp))
  15. return 0;
  16. long rval = getrval2(tcp);
  17. if (rval == -1)
  18. return 0;
  19. static const char const fmt[] = "%s %ld";
  20. static char outstr[sizeof(fmt) + 3 * sizeof(rval)];
  21. xsprintf(outstr, fmt, what, rval);
  22. tcp->auxstr = outstr;
  23. return RVAL_STR;
  24. }
  25. SYS_FUNC(getxpid)
  26. {
  27. return decode_getxxid(tcp, "ppid");
  28. }
  29. SYS_FUNC(getxuid)
  30. {
  31. return decode_getxxid(tcp, "euid");
  32. }
  33. SYS_FUNC(getxgid)
  34. {
  35. return decode_getxxid(tcp, "egid");
  36. }
  37. SYS_FUNC(osf_statfs)
  38. {
  39. printpath(tcp, tcp->u_arg[0]);
  40. tprints(", ");
  41. printaddr(tcp->u_arg[1]);
  42. tprints(", ");
  43. tprintf("%lu", tcp->u_arg[2]);
  44. return RVAL_DECODED;
  45. }
  46. SYS_FUNC(osf_fstatfs)
  47. {
  48. printfd(tcp, tcp->u_arg[0]);
  49. tprints(", ");
  50. printaddr(tcp->u_arg[1]);
  51. tprints(", ");
  52. tprintf("%lu", tcp->u_arg[2]);
  53. return RVAL_DECODED;
  54. }
  55. #endif /* ALPHA */