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.

watchdog_ioctl.c 922B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. /*
  2. * Copyright (c) 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 "print_fields.h"
  9. #include <linux/watchdog.h>
  10. #define XLAT_MACROS_ONLY
  11. #include "xlat/watchdog_ioctl_cmds.h"
  12. #undef XLAT_MACROS_ONLY
  13. int
  14. watchdog_ioctl(struct tcb *const tcp, const unsigned int code,
  15. const kernel_ulong_t arg)
  16. {
  17. switch (code) {
  18. case WDIOC_GETSTATUS:
  19. case WDIOC_GETBOOTSTATUS:
  20. case WDIOC_GETTEMP:
  21. case WDIOC_GETTIMEOUT:
  22. case WDIOC_GETPRETIMEOUT:
  23. case WDIOC_GETTIMELEFT:
  24. if (entering(tcp))
  25. return 0;
  26. ATTRIBUTE_FALLTHROUGH;
  27. case WDIOC_SETTIMEOUT:
  28. case WDIOC_SETPRETIMEOUT:
  29. tprints(", ");
  30. printnum_int(tcp, arg, "%d");
  31. break;
  32. /*
  33. * linux/watchdog.h says that this takes an int, but in
  34. * practice the argument is ignored.
  35. */
  36. case WDIOC_KEEPALIVE:
  37. break;
  38. default:
  39. return RVAL_DECODED;
  40. }
  41. return RVAL_IOCTL_DECODED;
  42. }