aboutsummaryrefslogtreecommitdiff
path: root/configure.ac
diff options
context:
space:
mode:
authorBruce A. Mah <bmah@es.net>2014-04-14 10:45:46 -0700
committerBruce A. Mah <bmah@es.net>2014-04-14 10:45:46 -0700
commit40a1faf3322bf9cff2d52405647c60eca112158f (patch)
tree71a07275a5e5b2f1462ce21f1dd409f5f3edefc7 /configure.ac
parent5976bac34ea067371c7b91845556eca3f31bd5e0 (diff)
downloadiperf3-40a1faf3322bf9cff2d52405647c60eca112158f.tar.gz
Improve detection of CPU affinity support (for FreeBSD and Linux).
As with several other recent commits, don't check explicitly for an OS platform, but rather detect the various API bits that are used to implement CPU affinity setting.
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac9
1 files changed, 9 insertions, 0 deletions
diff --git a/configure.ac b/configure.ac
index c516c74..5695c30 100644
--- a/configure.ac
+++ b/configure.ac
@@ -75,4 +75,13 @@ if test "x$iperf3_cv_header_flowlabel" = "xyes"; then
AC_DEFINE([HAVE_FLOWLABEL], [1], [Have IPv6 flowlabel support.])
fi
+# Check for CPU affinity support. FreeBSD and Linux do this differently
+# unfortunately so we have to check separately for each of them.
+# FreeBSD uses cpuset_setaffinity while Linux uses sched_setaffinity.
+# Define HAVE_CPU_AFFINITY to indicate the CPU affinity setting as a
+# generic concept is available.
+AC_CHECK_FUNCS([cpuset_setaffinity sched_setaffinity],
+ AC_DEFINE([HAVE_CPU_AFFINITY], [1],
+ [Have CPU affinity support.]))
+
AC_OUTPUT([Makefile src/Makefile examples/Makefile])