0028-harness-Skip-the-test-if-io_pgetevents-is-not-implem.patch 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. From d2029c6693561b555723b228c9172fd2dc02646e Mon Sep 17 00:00:00 2001
  2. From: Guillem Jover <guillem@hadrons.org>
  3. Date: Wed, 21 Aug 2019 05:29:52 +0200
  4. Subject: [PATCH libaio 28/28] harness: Skip the test if io_pgetevents() is not
  5. implemented
  6. Either the kernel or the syscall wrapper will return -ENOSYS when this
  7. syscall is not implemented. So we should cope with this in the test
  8. suite and SKIP the test case.
  9. This is currently the case for alpha and ia64, even though they have
  10. already been wired up very recently in the kernel mainline.
  11. Signed-off-by: Guillem Jover <guillem@hadrons.org>
  12. Signed-off-by: Jeff Moyer <jmoyer@redhat.com>
  13. ---
  14. harness/cases/22.t | 7 +++++++
  15. 1 file changed, 7 insertions(+)
  16. diff --git a/harness/cases/22.t b/harness/cases/22.t
  17. index c47140d..d6a8986 100644
  18. --- a/harness/cases/22.t
  19. +++ b/harness/cases/22.t
  20. @@ -98,6 +98,10 @@ int test_main(void)
  21. ret = io_pgetevents(ctx, 1, 1, &ev, &to, &sigmask);
  22. } while (ret == 0);
  23. + /* SKIP if the syscall has not been implemented. */
  24. + if (ret == -ENOSYS)
  25. + return 3;
  26. +
  27. if (ret != -EINTR) {
  28. printf("child: io_pgetevents did not set errno to "
  29. "EINTR: %s\n", strerror(-ret));
  30. @@ -135,6 +139,9 @@ int test_main(void)
  31. kill(p, SIGUSR1);
  32. ret = io_pgetevents(ctx, 1, 1, &ev, NULL, &sigmask);
  33. + /* SKIP if the syscall has not been implemented. */
  34. + if (ret == -ENOSYS)
  35. + return 3;
  36. if (ret < 0) {
  37. printf("parent: io_pgetevents failed: %s\n",
  38. strerror(-ret));
  39. --
  40. 2.26.0.292.g33ef6b2f38