]> git.michaelhowe.org Git - packages/o/openafs.git/commitdiff
STABLE12-linux-try-sys-wait4-20030516
authorDerrick Brashear <shadow@dementia.org>
Fri, 16 May 2003 18:43:21 +0000 (18:43 +0000)
committerDerrick Brashear <shadow@dementia.org>
Fri, 16 May 2003 18:43:21 +0000 (18:43 +0000)
we may have close/wait4 instead of close/chdir or open/exit

(cherry picked from commit a8b536e7d3f45abd20fa0ea293f5f313189114d4)

acinclude.m4
src/afs/LINUX/osi_module.c
src/cf/linux-test4.m4

index d0ce5f17d8948f6741014a9940db44d3c60328b9..340696980a190acb15cf495616e6fbe88ec2413d 100644 (file)
@@ -173,6 +173,7 @@ case $system in
                    LINUX_EXPORTS_SYS_CALL_TABLE
                    LINUX_EXPORTS_SYS_CHDIR
                    LINUX_EXPORTS_SYS_CLOSE
+                   LINUX_EXPORTS_SYS_WAIT4
                    if test "x$ac_cv_linux_exports_sys_call_table" = "xno"; then
                          linux_syscall_method=none
                          if test "x$ac_cv_linux_exports_init_mm" = "xyes"; then
@@ -193,6 +194,9 @@ case $system in
                         if test "x$ac_cv_linux_exports_sys_close" = "xyes" ; then
                          AC_DEFINE(EXPORTED_SYS_CLOSE, 1, [define if your linux kernel exports sys_close])
                         fi
+                        if test "x$ac_cv_linux_exports_sys_wait4" = "xyes" ; then
+                         AC_DEFINE(EXPORTED_SYS_WAIT4, 1, [define if your linux kernel exports sys_wait4])
+                        fi
                    fi
                  fi
                 if test "x$ac_cv_linux_exports_tasklist_lock" = "xyes" ; then
index 92047b0292d4f38de809081f518c03027dfc682d..5ccf89e915b57575a21de5164cb931db1eebe6c6 100644 (file)
@@ -283,6 +283,13 @@ int init_module(void)
            break;
        }
 #else
+#if defined(EXPORTED_SYS_WAIT4) && defined(EXPORTED_SYS_CLOSE)
+        if (ptr[0] == (unsigned long)&sys_close &&
+            ptr[__NR_wait4 - __NR_close] == (unsigned long)&sys_wait4) {
+            sys_call_table=ptr - __NR_close;
+            break;
+        }
+#else
 #if defined(EXPORTED_SYS_CHDIR) && defined(EXPORTED_SYS_CLOSE)
         if (ptr[0] == (unsigned long)&sys_close &&
            ptr[__NR_chdir - __NR_close] == (unsigned long)&sys_chdir) {
@@ -296,6 +303,7 @@ int init_module(void)
            break;
        }
 #endif
+#endif
 #endif
     }
 #ifdef EXPORTED_KALLSYMS_ADDRESS
index 6b4386b18281347c7f174ffd0299ca5fb952a35a..024a0bfa5f9590988d8bd34d6713140ce77b95b6 100644 (file)
@@ -154,6 +154,23 @@ AC_MSG_RESULT($ac_cv_linux_exports_sys_close)
 CPPFLAGS="$save_CPPFLAGS"])
 
 
+AC_DEFUN(LINUX_EXPORTS_SYS_WAIT4, [
+AC_MSG_CHECKING(for exported sys_wait4)
+save_CPPFLAGS="$CPPFLAGS"
+CPPFLAGS="-I${LINUX_KERNEL_PATH}/include -D__KERNEL__ $CPPFLAGS"
+AC_CACHE_VAL(ac_cv_linux_exports_sys_wait4,
+[
+AC_TRY_COMPILE(
+[#include <linux/modversions.h>],
+[#ifndef __ver_sys_wait4
+#error sys_wait4 not exported
+#endif],
+ac_cv_linux_exports_sys_wait4=yes,
+ac_cv_linux_exports_sys_wait4=no)])
+AC_MSG_RESULT($ac_cv_linux_exports_sys_wait4)
+CPPFLAGS="$save_CPPFLAGS"])
+
+
 AC_DEFUN(LINUX_EXPORTS_TASKLIST_LOCK, [
 AC_MSG_CHECKING(for exported tasklist_lock)
 save_CPPFLAGS="$CPPFLAGS"