From: Derrick Brashear Date: Fri, 16 May 2003 18:42:28 +0000 (+0000) Subject: linux-try-sys-wait4-20030516 X-Git-Tag: openafs-devel-1_3_50~214 X-Git-Url: https://git.michaelhowe.org/gitweb/?a=commitdiff_plain;h=a8b536e7d3f45abd20fa0ea293f5f313189114d4;p=packages%2Fo%2Fopenafs.git linux-try-sys-wait4-20030516 we may have close/wait4 instead of close/chdir or open/exit --- diff --git a/acinclude.m4 b/acinclude.m4 index ab2b77179..0ce0f352f 100644 --- a/acinclude.m4 +++ b/acinclude.m4 @@ -184,6 +184,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 @@ -204,6 +205,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 diff --git a/src/afs/LINUX/osi_module.c b/src/afs/LINUX/osi_module.c index 9f4fad7ce..cab7e6b34 100644 --- a/src/afs/LINUX/osi_module.c +++ b/src/afs/LINUX/osi_module.c @@ -280,6 +280,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) { @@ -293,6 +300,7 @@ int init_module(void) break; } #endif +#endif #endif } #ifdef EXPORTED_KALLSYMS_ADDRESS diff --git a/src/cf/linux-test4.m4 b/src/cf/linux-test4.m4 index 6b4386b18..024a0bfa5 100644 --- a/src/cf/linux-test4.m4 +++ b/src/cf/linux-test4.m4 @@ -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 ], +[#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"