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.

37 lines
1.4 KiB

  1. From a5e564bdd14dbda666fc7caffecc0f6e3527df85 Mon Sep 17 00:00:00 2001
  2. From: Alexandru Ardelean <ardeleanalex@gmail.com>
  3. Date: Fri, 12 Aug 2022 15:36:02 +0300
  4. Subject: [PATCH] stress-sysinval: fix fstat/fstat64 compat check
  5. It seems that __NR_fstat64 may be defined while __NR_fstat may be
  6. undefined.
  7. Looking at the kernel file 'include/uapi/asm-generic/unistd.h' this looks
  8. possible where there is a 32-bit arch.
  9. In any case, checking that __NR_fstat64 exists/has-a-value when adding it
  10. to the table looks like a good idea, vs adding __NR_fstat.
  11. This was found when updating stress-ng here:
  12. https://github.com/openwrt/packages/pull/19048
  13. The ARCHS (or ARC) build is failing. No idea why it's the only one.
  14. But this patch fixes it.
  15. Signed-off-by: Alexandru Ardelean <ardeleanalex@gmail.com>
  16. ---
  17. stress-sysinval.c | 4 ++--
  18. 1 file changed, 2 insertions(+), 2 deletions(-)
  19. --- a/stress-sysinval.c
  20. +++ b/stress-sysinval.c
  21. @@ -590,8 +590,8 @@ static const stress_syscall_arg_t stress
  22. { SYS(fstat), 2, { ARG_FD, ARG_PTR_WR, 0, 0, 0, 0 } },
  23. #endif
  24. #if DEFSYS(fstat64)
  25. - { SYS(fstat), 2, { ARG_FD, ARG_PTR, 0, 0, 0, 0 } },
  26. - { SYS(fstat), 2, { ARG_FD, ARG_PTR_WR, 0, 0, 0, 0 } },
  27. + { SYS(fstat64), 2, { ARG_FD, ARG_PTR, 0, 0, 0, 0 } },
  28. + { SYS(fstat64), 2, { ARG_FD, ARG_PTR_WR, 0, 0, 0, 0 } },
  29. #endif
  30. #if DEFSYS(fstatat)
  31. { SYS(fstatat), 4, { ARG_DIRFD, ARG_EMPTY_FILENAME, ARG_PTR, ARG_FLAG, 0, 0 } },