# Checks for header libraries functions.
CHECK_LIBRARY_EXISTS(rt clock_gettime "" HAVE_POSIX_GETTIME)
CHECK_LIBRARY_EXISTS(pthread pthread_setaffinity_np "" HAVE_PTHREAD_SETAFFINITY)
+CHECK_INCLUDE_FILE("pthread_np" HAVE_PTHREAD_NP_H) # for pthread_setaffinity_np() on FreeBSD
if(CMAKE_SYSTEM_NAME MATCHES "Darwin")
set(CMAKE_REQUIRED_DEFINITIONS "-D_XOPEN_SOURCE=700 -D_DARWIN_C_SOURCE")
#cmakedefine01 HAVE_UCONTEXT_CONTEXTS
/* Variables for the thread contexts (and parallel mode of raw contexts) */
-/* Does not seems defined on Mac nor Windows */
+/* pthread_setaffinity_np() is Linux and FreeBSD but not on Mac nor Windows */
#cmakedefine01 HAVE_PTHREAD_SETAFFINITY
+/* pthread_setaffinity_np() defined in pthread_np.h on FreeBSD but not Linux */
+#cmakedefine01 HAVE_PTHREAD_NP_H
/* Variables for the raw contexts (to select the right assembly code) */
#cmakedefine01 SIMGRID_PROCESSOR_i686