From 145df5da7bc0323bf1817c9c8602482726aa5a08 Mon Sep 17 00:00:00 2001 From: Martin Quinson Date: Mon, 16 Nov 2015 16:04:42 +0100 Subject: [PATCH 1/1] deal with portability issues induced by ptrace --- CMakeLists.txt | 1 + src/simix/smx_global.c | 6 +++++- tools/cmake/src/internal_config.h.in | 3 +++ 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index c5a2b3cf42..dff73aab7d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -311,6 +311,7 @@ CHECK_INCLUDE_FILE("valgrind/valgrind.h" HAVE_VALGRIND_VALGRIND_H) CHECK_INCLUDE_FILE("socket.h" HAVE_SOCKET_H) CHECK_INCLUDE_FILE("stat.h" HAVE_STAT_H) CHECK_INCLUDE_FILE("sys/stat.h" HAVE_SYS_STAT_H) +CHECK_INCLUDE_FILE("sys/ptrace.h" HAVE_SYS_PTRACE_H) CHECK_INCLUDE_FILE("windows.h" HAVE_WINDOWS_H) CHECK_INCLUDE_FILE("errno.h" HAVE_ERRNO_H) CHECK_INCLUDE_FILE("unistd.h" HAVE_UNISTD_H) diff --git a/src/simix/smx_global.c b/src/simix/smx_global.c index 36a805e81f..e1bf5ae9c4 100644 --- a/src/simix/smx_global.c +++ b/src/simix/smx_global.c @@ -5,7 +5,11 @@ * under the terms of the license (GNU LGPL) which comes with this package. */ #include -#include +#include "src/portable.h" +#ifdef HAVE_SYS_PTRACE_H +# include +# include +#endif #include "smx_private.h" #include "xbt/heap.h" diff --git a/tools/cmake/src/internal_config.h.in b/tools/cmake/src/internal_config.h.in index 1cd052fc85..9a41c9e118 100644 --- a/tools/cmake/src/internal_config.h.in +++ b/tools/cmake/src/internal_config.h.in @@ -201,6 +201,9 @@ /* Define to 1 if you have the header file. */ #cmakedefine HAVE_SYS_STAT_H @HAVE_SYS_STAT_H@ +/* Define to 1 if you have the header file. */ +#cmakedefine HAVE_SYS_PTRACE_H @HAVE_SYS_PTRACE_H@ + /* Define to 1 if you have the header file. */ #cmakedefine HAVE_SYS_TIME_H @HAVE_SYS_TIME_H@ -- 2.20.1