]> git.proxmox.com Git - mirror_spl-debian.git/commitdiff
Linux 4.11 compat: add linux/sched/signal.h
authorOlaf Faaland <faaland1@llnl.gov>
Tue, 7 Mar 2017 23:33:50 +0000 (15:33 -0800)
committerBrian Behlendorf <behlendorf1@llnl.gov>
Tue, 21 Mar 2017 00:43:43 +0000 (17:43 -0700)
In Linux 4.11, torvalds/linux@2a1f062, signal handling related functions
were moved from sched.h into sched/signal.h.

Add configure checks to detect this and include the new file where
needed.

Reviewed-by: Chunwei Chen <david.chen@osnexus.com>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Olaf Faaland <faaland1@llnl.gov>
Closes #608

config/spl-build.m4
include/sys/signal.h

index fc0efcf39cbdf1132d3cb28d699989603f697543..1dbc87e615163818c4109e9edbe390f87ff6b3fd 100644 (file)
@@ -43,6 +43,7 @@ AC_DEFUN([SPL_AC_CONFIG_KERNEL], [
        SPL_AC_RWSEM_ACTIVITY
        SPL_AC_RWSEM_ATOMIC_LONG_COUNT
        SPL_AC_SCHED_RT_HEADER
+       SPL_AC_SCHED_SIGNAL_HEADER
        SPL_AC_4ARGS_VFS_GETATTR
        SPL_AC_3ARGS_VFS_GETATTR
        SPL_AC_2ARGS_VFS_GETATTR
@@ -1411,6 +1412,24 @@ AC_DEFUN([SPL_AC_SCHED_RT_HEADER],
        ])
 ])
 
+dnl #
+dnl # 4.11 API change,
+dnl # Moved things from linux/sched.h to linux/sched/signal.h
+dnl #
+AC_DEFUN([SPL_AC_SCHED_SIGNAL_HEADER],
+       [AC_MSG_CHECKING([whether header linux/sched/signal.h exists])
+       SPL_LINUX_TRY_COMPILE([
+               #include <linux/sched.h>
+               #include <linux/sched/signal.h>
+       ],[
+               return 0;
+       ],[
+               AC_DEFINE(HAVE_SCHED_SIGNAL_HEADER, 1, [linux/sched/signal.h exists])
+               AC_MSG_RESULT(yes)
+       ],[
+               AC_MSG_RESULT(no)
+       ])
+])
 
 dnl #
 dnl # 4.11 API, a528d35e@torvalds/linux
index 823fea32912e99b17fd2657b159dd0e3e1f66f1c..77cc2d3c2fb5a553ff1ad074df7b8ed1dfb10747 100644 (file)
 
 #include <linux/sched.h>
 
+#ifdef HAVE_SCHED_SIGNAL_HEADER
+#include <linux/sched/signal.h>
+#endif
+
 #define        FORREAL         0       /* Usual side-effects */
 #define        JUSTLOOKING     1       /* Don't stop the process */