From 9075eb84d22e49ee4a6cd59e9d466aa56166ad0f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADtor=20Santos=20Costa?= Date: Mon, 5 Oct 2015 10:31:13 +0100 Subject: [PATCH] sys/syscalls and gettid --- cmake/Config.cmake | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/cmake/Config.cmake b/cmake/Config.cmake index c31cfd277..bdeb9e104 100644 --- a/cmake/Config.cmake +++ b/cmake/Config.cmake @@ -13,6 +13,8 @@ check_include_file( fcntl.h HAVE_FCNTL_H ) check_include_file( fenv.h HAVE_FENV_H ) check_include_files(fmemopen.h HAVE_FMEMOPEN_H) check_include_file( fpu_control.h HAVE_FPU_CONTROL_H ) +check_function_exists(gettid HAVE_GETTID) # gettid() actually doesn't exist by itself, one must call syscall(SYS_gettid); instead +check_symbol_exists(SYS_gettid sys/syscall.h HAVE_SYS_GETTID) #this only works if we force include syscall.h on the files that want to call gettid check_include_file( ieeefp.h HAVE_IEEEFP_H ) check_include_file( inttypes.h HAVE_INTTYPES_H ) check_include_file( io.h HAVE_IO_H ) @@ -55,7 +57,7 @@ check_include_file( sys/select.h HAVE_SYS_SELECT_H ) check_include_file( sys/shm.h HAVE_SYS_SHM_H ) check_include_file( sys/socket.h HAVE_SYS_SOCKET_H ) check_include_file( sys/stat.h HAVE_SYS_STAT_H ) -check_include_files(sys/time.h HAVE_SYS_TIME_H) +check_include_file( sys/syscall.h HAVE_SYS_SYSCALL_H) check_include_file( sys/times.h HAVE_SYS_TIMES_H ) check_include_file( sys/time.h HAVE_SYS_TIME_H ) check_include_file( sys/types.h HAVE_SYS_TYPES_H ) @@ -333,4 +335,4 @@ check_function_exists( _chsize_s HAVE__CHSIZE_S ) check_function_exists( _NSGetEnviron HAVE__NSGETENVIRON ) check_symbol_exists( __NR_gettid "sys/syscall.h;unistd.h" HAVE_GETTID_SYSCALL ) -check_symbol_exists( gettid "sys/syscall.h;unistd.h" HAVE_GETTID_MACRO ) \ No newline at end of file +check_symbol_exists( gettid "sys/syscall.h;unistd.h" HAVE_GETTID_MACRO )