]])
AC_CHECK_FUNC([sched_setaffinity], [hwloc_have_sched_setaffinity=yes])
AC_CHECK_HEADERS([sys/cpuset.h],,,[[#include <sys/param.h>]])
+ AC_CHECK_FUNCS([cpuset_setaffinity])
AC_SEARCH_LIBS([pthread_getthrds_np], [pthread],
AC_DEFINE([HWLOC_HAVE_PTHREAD_GETTHRDS_NP], 1, `Define to 1 if you have pthread_getthrds_np')
)
/*
* Copyright © 2009 CNRS
* Copyright © 2009-2011 inria. All rights reserved.
- * Copyright © 2009-2010 Université Bordeaux 1
+ * Copyright © 2009-2010, 2012 Université Bordeaux 1
* Copyright © 2011 Cisco Systems, Inc. All rights reserved.
* See COPYING in top-level directory.
*/
#include <private/private.h>
#include <private/debug.h>
-#ifdef HAVE_SYS_CPUSET_H
+#if defined(HAVE_SYS_CPUSET_H) && defined(HAVE_CPUSET_SETAFFINITY)
static void
hwloc_freebsd_bsd2hwloc(hwloc_bitmap_t hwloc_cpuset, const cpuset_t *cpuset)
{
void
hwloc_set_freebsd_hooks(struct hwloc_topology *topology)
{
-#ifdef HAVE_SYS_CPUSET_H
+#if defined(HAVE_SYS_CPUSET_H) && defined(HAVE_CPUSET_SETAFFINITY)
topology->set_thisproc_cpubind = hwloc_freebsd_set_thisproc_cpubind;
topology->get_thisproc_cpubind = hwloc_freebsd_get_thisproc_cpubind;
topology->set_thisthread_cpubind = hwloc_freebsd_set_thisthread_cpubind;