-#
-# LN_STRUCT_SIGHAND
-#
-# red hat 2.4 adds sighand to struct task_struct
-#
-AC_DEFUN([LN_STRUCT_SIGHAND],
-[AC_MSG_CHECKING([if task_struct has a sighand field])
-LB_LINUX_TRY_COMPILE([
- #include <linux/sched.h>
-],[
- struct task_struct p;
- p.sighand = NULL;
-],[
- AC_DEFINE(CONFIG_RH_2_4_20, 1, [this kernel contains Red Hat 2.4.20 patches])
- AC_MSG_RESULT([yes])
-],[
- AC_MSG_RESULT([no])
-])
-])
-
-#
-# LN_FUNC_CPU_ONLINE
-#
-# cpu_online is different in rh 2.4, vanilla 2.4, and 2.6
-#
-AC_DEFUN([LN_FUNC_CPU_ONLINE],
-[AC_MSG_CHECKING([if kernel defines cpu_online()])
-LB_LINUX_TRY_COMPILE([
- #include <linux/sched.h>
-],[
- cpu_online(0);
-],[
- AC_MSG_RESULT([yes])
- AC_DEFINE(HAVE_CPU_ONLINE, 1, [cpu_online found])
-],[
- AC_MSG_RESULT([no])
-])
-])
-
-#
-# LN_TYPE_GFP_T
-#
-# check if gfp_t is typedef-ed
-#
-AC_DEFUN([LN_TYPE_GFP_T],
-[AC_MSG_CHECKING([if kernel defines gfp_t])
-LB_LINUX_TRY_COMPILE([
- #include <linux/gfp.h>
-],[
- return sizeof(gfp_t);
-],[
- AC_MSG_RESULT([yes])
- AC_DEFINE(HAVE_GFP_T, 1, [gfp_t found])
-],[
- AC_MSG_RESULT([no])
-])
-])
-
-#
-# LN_TYPE_CPUMASK_T
-#
-# same goes for cpumask_t
-#
-AC_DEFUN([LN_TYPE_CPUMASK_T],
-[AC_MSG_CHECKING([if kernel defines cpumask_t])
-LB_LINUX_TRY_COMPILE([
- #include <linux/sched.h>
-],[
- return sizeof (cpumask_t);
-],[
- AC_MSG_RESULT([yes])
- AC_DEFINE(HAVE_CPUMASK_T, 1, [cpumask_t found])
-],[
- AC_MSG_RESULT([no])
-])
-])
-
-#
-# LN_FUNC_SHOW_TASK
-#
-# we export show_task(), but not all kernels have it (yet)
-#
-AC_DEFUN([LN_FUNC_SHOW_TASK],
-[AC_MSG_CHECKING([if kernel exports show_task])
-have_show_task=0
-for file in ksyms sched ; do
- if grep -q "EXPORT_SYMBOL(show_task)" \
- "$LINUX/kernel/$file.c" 2>/dev/null ; then
- have_show_task=1
- break
- fi
-done
-if test x$have_show_task = x1 ; then
- AC_DEFINE(HAVE_SHOW_TASK, 1, [show_task is exported])
- AC_MSG_RESULT([yes])
-else
- AC_MSG_RESULT([no])
-fi
-])
-
-# LN_TASKLIST_LOCK
-# 2.6.18 remove tasklist_lock export
-AC_DEFUN([LN_TASKLIST_LOCK],
-[AC_MSG_CHECKING([kernel export tasklist_lock])
- if grep -q "EXPORT_SYMBOL(tasklist_lock)" \
- "$LINUX/kernel/fork.c" 2>/dev/null ; then
- AC_DEFINE(HAVE_TASKLIST_LOCK, 1,
- [tasklist_lock exported])
- AC_MSG_RESULT([yes])
- else
- AC_MSG_RESULT([no])
- fi
-])
-
-# 2.6.19 API changes
-# kmem_cache_destroy(cachep) return void instead of
-# int
-AC_DEFUN([LN_KMEM_CACHE_DESTROY_INT],
-[AC_MSG_CHECKING([kmem_cache_destroy(cachep) return int])
-LB_LINUX_TRY_COMPILE([
- #include <linux/slab.h>
-],[
- int i = kmem_cache_destroy(NULL);
-],[
- AC_MSG_RESULT(yes)
- AC_DEFINE(HAVE_KMEM_CACHE_DESTROY_INT, 1,
- [kmem_cache_destroy(cachep) return int])
-],[
- AC_MSG_RESULT(NO)
-])
-])
-
-#2.6.19 API change
-#panic_notifier_list use atomic_notifier operations
-#
-AC_DEFUN([LN_ATOMIC_PANIC_NOTIFIER],
-[AC_MSG_CHECKING([panic_notifier_list is atomic])
-LB_LINUX_TRY_COMPILE([
- #include <linux/notifier.h>
- #include <linux/kernel.h>
-],[
- struct atomic_notifier_head panic_notifier_list;
-],[
- AC_MSG_RESULT(yes)
- AC_DEFINE(HAVE_ATOMIC_PANIC_NOTIFIER, 1,
- [panic_notifier_list is atomic_notifier_head])
-],[
- AC_MSG_RESULT(NO)
-])
-])