From 7109a0d3a3a13951be7f6f7f06487ddeb075a847 Mon Sep 17 00:00:00 2001 From: Derrick Brashear Date: Wed, 19 Mar 2003 22:22:59 +0000 Subject: [PATCH] STABLE12-redhat-81-support-again-20030319 once more. maybe this time they'll release something that looks like this (cherry picked from commit 284d3edd2375f672057aef638c0e0afd41cc559d) --- acconfig.h | 1 + acinclude.m4 | 4 ++++ src/afs/LINUX/osi_machdep.h | 12 +++++++++--- src/cf/linux-test4.m4 | 15 +++++++++++++++ 4 files changed, 29 insertions(+), 3 deletions(-) diff --git a/acconfig.h b/acconfig.h index 119ecb1d8d..77efb5848c 100644 --- a/acconfig.h +++ b/acconfig.h @@ -45,6 +45,7 @@ static /**/const char *const rcsid[] = { (char *)rcsid, "\100(#)" msg } #undef STRUCT_INODE_HAS_I_TRUNCATE_SEM #undef STRUCT_TASK_STRUCT_HAS_PARENT #undef STRUCT_TASK_STRUCT_HAS_REAL_PARENT +#undef STRUCT_TASK_STRUCT_HAS_SIGHAND #undef STRUCT_TASK_STRUCT_HAS_SIGMASK_LOCK #undef ssize_t diff --git a/acinclude.m4 b/acinclude.m4 index 844cd3eb1f..d6edf86b32 100644 --- a/acinclude.m4 +++ b/acinclude.m4 @@ -154,6 +154,7 @@ case $system in LINUX_RECALC_SIGPENDING_ARG_TYPE LINUX_SCHED_STRUCT_TASK_STRUCT_HAS_PARENT LINUX_SCHED_STRUCT_TASK_STRUCT_HAS_REAL_PARENT + LINUX_SCHED_STRUCT_TASK_STRUCT_HAS_SIGHAND LINUX_SCHED_STRUCT_TASK_STRUCT_HAS_SIGMASK_LOCK LINUX_WHICH_MODULES if test "x$ac_cv_linux_config_modversions" = "xno"; then @@ -239,6 +240,9 @@ case $system in if test "x$ac_cv_linux_sched_struct_task_struct_has_sigmask_lock" = "xyes"; then AC_DEFINE(STRUCT_TASK_STRUCT_HAS_SIGMASK_LOCK, 1, [define if your struct task_struct has sigmask_lock]) fi + if test "x$ac_cv_linux_sched_struct_task_struct_has_sighand" = "xyes"; then + AC_DEFINE(STRUCT_TASK_STRUCT_HAS_SIGHAND, 1, [define if your struct task_struct has sighand]) + fi : fi ;; diff --git a/src/afs/LINUX/osi_machdep.h b/src/afs/LINUX/osi_machdep.h index e0efbbc0ee..a9ff198ed5 100644 --- a/src/afs/LINUX/osi_machdep.h +++ b/src/afs/LINUX/osi_machdep.h @@ -62,7 +62,11 @@ static inline int _has_pending_signals(sigset_t *signal, sigset_t *blocked) static inline void _recalc_sigpending_tsk(struct task_struct *t) { t->sigpending = PENDING(&t->pending, &t->blocked) || - PENDING(&t->sig->shared_pending, &t->blocked); +#ifdef STRUCT_TASK_STRUCT_HAS_SIG + PENDING(&t->sig->shared_pending, &t->blocked); +#else + PENDING(&t->signal->shared_pending, &t->blocked); +#endif } #define RECALC_SIGPENDING(X) _recalc_sigpending_tsk(X) @@ -70,15 +74,17 @@ static inline void _recalc_sigpending_tsk(struct task_struct *t) #define RECALC_SIGPENDING(X) recalc_sigpending(X) #endif -#ifdef STRUCT_TASK_STRUCT_HAS_SIGMASK_LOCK +#if defined (STRUCT_TASK_STRUCT_HAS_SIGMASK_LOCK) #define SIG_LOCK(X) spin_lock_irq(&X->sigmask_lock) #define SIG_UNLOCK(X) spin_unlock_irq(&X->sigmask_lock) +#elif defined (STRUCT_TASK_STRUCT_HAS_SIGHAND) +#define SIG_LOCK(X) spin_lock_irq(&X->sighand->siglock) +#define SIG_UNLOCK(X) spin_unlock_irq(&X->sighand->siglock) #else #define SIG_LOCK(X) spin_lock_irq(&X->sig->siglock) #define SIG_UNLOCK(X) spin_unlock_irq(&X->sig->siglock) #endif - #define afs_hz HZ #define osi_Time() (xtime.tv_sec) #if (CPU == sparc64) diff --git a/src/cf/linux-test4.m4 b/src/cf/linux-test4.m4 index ca3942dbc4..b5df711c5d 100644 --- a/src/cf/linux-test4.m4 +++ b/src/cf/linux-test4.m4 @@ -312,3 +312,18 @@ ac_cv_linux_sched_struct_task_struct_has_sigmask_lock=yes, ac_cv_linux_sched_struct_task_struct_has_sigmask_lock=no)]) AC_MSG_RESULT($ac_cv_linux_sched_struct_task_struct_has_sigmask_lock) CPPFLAGS="$save_CPPFLAGS"]) + +AC_DEFUN(LINUX_SCHED_STRUCT_TASK_STRUCT_HAS_SIGHAND, [ +AC_MSG_CHECKING(for sighand in struct task_struct) +save_CPPFLAGS="$CPPFLAGS" +CPPFLAGS="-I${LINUX_KERNEL_PATH}/include -D__KERNEL__ $CPPFLAGS" +AC_CACHE_VAL(ac_cv_linux_sched_struct_task_struct_has_sighand, +[ +AC_TRY_COMPILE( +[#include ], +[struct task_struct _tsk; +printf("%d\n", _tsk.sighand);], +ac_cv_linux_sched_struct_task_struct_has_sighand=yes, +ac_cv_linux_sched_struct_task_struct_has_sighand=no)]) +AC_MSG_RESULT($ac_cv_linux_sched_struct_task_struct_has_sighand) +CPPFLAGS="$save_CPPFLAGS"])