Skip to content

Commit

Permalink
Linux 4.11 compat: add linux/sched/signal.h
Browse files Browse the repository at this point in the history
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 <[email protected]>
Reviewed-by: Brian Behlendorf <[email protected]>
Signed-off-by: Olaf Faaland <[email protected]>
Closes openzfs#608
  • Loading branch information
ofaaland authored and behlendorf committed Mar 21, 2017
1 parent 94b1ab2 commit 9a054d5
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 0 deletions.
19 changes: 19 additions & 0 deletions config/spl-build.m4
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
4 changes: 4 additions & 0 deletions include/sys/signal.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,10 @@

#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 */

Expand Down

0 comments on commit 9a054d5

Please sign in to comment.