aboutsummaryrefslogtreecommitdiff
path: root/sysdeps/unix/sysv/linux/tst-skeleton-affinity.c
diff options
context:
space:
mode:
authorSergey Kolosov <skolosov@redhat.com>2025-01-28 23:56:26 +0100
committerDJ Delorie <dj@redhat.com>2025-03-07 17:50:44 -0500
commita9017caff3b77032d04e2e439f7c04a63241e63e (patch)
tree72d9c913ca38e0b6d5de4758b0121b3ed3a183ba /sysdeps/unix/sysv/linux/tst-skeleton-affinity.c
parent6ef0bd02dbe34aab8b956ffa2db5679341d520f5 (diff)
downloadglibc-a9017caff3b77032d04e2e439f7c04a63241e63e.zip
glibc-a9017caff3b77032d04e2e439f7c04a63241e63e.tar.gz
glibc-a9017caff3b77032d04e2e439f7c04a63241e63e.tar.bz2
nptl: extend test coverage for sched_yield
We add sched_yield() API testing to the existing thread affinity test case because it allows us to test sched_yield() operation in the following scenarios: * On a main thread. * On multiple threads simultaneously. * On every CPU the system reports simultaneously. The ensures we exercise sched_yield() in as many scenarios as we would exercise calls to the affinity functions. Additionally, the test is improved by adding a semaphore to coordinate all the threads running, so that an early starter thread won't consume cpu resources that could be used to start the other threads. Co-authored-by: DJ Delorie <dj@redhat.com> Reviewed-by: Carlos O'Donell <carlos@redhat.com>
Diffstat (limited to 'sysdeps/unix/sysv/linux/tst-skeleton-affinity.c')
-rw-r--r--sysdeps/unix/sysv/linux/tst-skeleton-affinity.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/sysdeps/unix/sysv/linux/tst-skeleton-affinity.c b/sysdeps/unix/sysv/linux/tst-skeleton-affinity.c
index c2bb80d..cf97c3f 100644
--- a/sysdeps/unix/sysv/linux/tst-skeleton-affinity.c
+++ b/sysdeps/unix/sysv/linux/tst-skeleton-affinity.c
@@ -38,6 +38,7 @@
#include <sched.h>
#include <stdbool.h>
#include <stdio.h>
+#include <support/test-driver.h>
/* CPU set configuration determined. Can be used from early_test. */
struct conf
@@ -253,12 +254,12 @@ do_test (void)
if (getaffinity (sizeof (set), &set) < 0 && errno == ENOSYS)
{
puts ("warning: getaffinity not supported, test cannot run");
- return 0;
+ return EXIT_UNSUPPORTED;
}
if (sched_getcpu () < 0 && errno == ENOSYS)
{
puts ("warning: sched_getcpu not supported, test cannot run");
- return 0;
+ return EXIT_UNSUPPORTED;
}
}