summaryrefslogtreecommitdiff
path: root/configure
diff options
context:
space:
mode:
authorJens Axboe <axboe@kernel.dk>2021-03-30 17:38:02 -0600
committerJens Axboe <axboe@kernel.dk>2021-03-30 17:38:02 -0600
commitdeb859d67f4951614037969d2657f30c50667936 (patch)
treee187e4ddfba751b6ad5635482fcbe49fe0d6707a /configure
parente7e536b665bd6a9d3e936e0847dbbb6957101da4 (diff)
downloadfio-deb859d67f4951614037969d2657f30c50667936.tar.gz
fio-deb859d67f4951614037969d2657f30c50667936.tar.bz2
configure: add test case for pthread_getaffinity_np()
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'configure')
-rwxr-xr-xconfigure27
1 files changed, 27 insertions, 0 deletions
diff --git a/configure b/configure
index 2f5ac91f..a7d82be0 100755
--- a/configure
+++ b/configure
@@ -418,6 +418,7 @@ CYGWIN*)
clock_monotonic="yes"
sched_idle="yes"
pthread_condattr_setclock="no"
+ pthread_affinity="no"
;;
esac
@@ -804,6 +805,29 @@ fi
print_config "pthread_sigmask()" "$pthread_sigmask"
##########################################
+# pthread_getaffinity_np() probe
+if test "$pthread_getaffinity" != "yes" ; then
+ pthread_getaffinity="no"
+fi
+cat > $TMPC <<EOF
+#include <stddef.h> /* NULL */
+#include <signal.h> /* pthread_sigmask() */
+#include <pthread.h>
+int main(void)
+{
+ cpu_set_t set;
+ return pthread_getaffinity_np(pthread_self(), sizeof(set), &set);
+}
+EOF
+if compile_prog "" "$LIBS" "pthread_getaffinity" ; then
+ pthread_getaffinity="yes"
+elif compile_prog "" "$LIBS -lpthread" "pthread_getaffinity" ; then
+ pthread_getaffinity="yes"
+ LIBS="$LIBS -lpthread"
+fi
+print_config "pthread_getaffinity_np()" "$pthread_getaffinity"
+
+##########################################
# solaris aio probe
if test "$solaris_aio" != "yes" ; then
solaris_aio="no"
@@ -2823,6 +2847,9 @@ fi
if test "$pthread_sigmask" = "yes" ; then
output_sym "CONFIG_PTHREAD_SIGMASK"
fi
+if test "$pthread_getaffinity" = "yes" ; then
+ output_sym "CONFIG_PTHREAD_GETAFFINITY"
+fi
if test "$have_asprintf" = "yes" ; then
output_sym "CONFIG_HAVE_ASPRINTF"
fi