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.

fs_x_ioctl.c 900B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. /*
  2. * Copyright (c) 2014 Mike Frysinger <vapier@gentoo.org>
  3. * Copyright (c) 2015-2016 Dmitry V. Levin <ldv@altlinux.org>
  4. * Copyright (c) 2016-2018 The strace developers.
  5. * All rights reserved.
  6. *
  7. * SPDX-License-Identifier: LGPL-2.1-or-later
  8. */
  9. #include "defs.h"
  10. #include <linux/fs.h>
  11. int
  12. fs_x_ioctl(struct tcb *const tcp, const unsigned int code,
  13. const kernel_ulong_t arg)
  14. {
  15. switch (code) {
  16. #ifdef FITRIM
  17. /* First seen in linux-2.6.37 */
  18. case FITRIM: {
  19. struct fstrim_range fstrim;
  20. tprints(", ");
  21. if (!umove_or_printaddr(tcp, arg, &fstrim))
  22. tprintf("{start=%#" PRIx64
  23. ", len=%#" PRIx64
  24. ", minlen=%#" PRIx64 "}",
  25. (uint64_t) fstrim.start,
  26. (uint64_t) fstrim.len,
  27. (uint64_t) fstrim.minlen);
  28. break;
  29. }
  30. #endif
  31. /* No arguments */
  32. #ifdef FIFREEZE
  33. case FIFREEZE:
  34. case FITHAW:
  35. break;
  36. #endif
  37. default:
  38. return RVAL_DECODED;
  39. }
  40. return RVAL_IOCTL_DECODED;
  41. }