]> git.michaelhowe.org Git - packages/o/openafs.git/commitdiff
Use autoconf to check for p_corefile in struct proc, rather than
authorNickolai Zeldovich <kolya@mit.edu>
Fri, 19 Apr 2002 05:47:30 +0000 (05:47 +0000)
committerGarry Zacheiss <zacheiss@mit.edu>
Fri, 19 Apr 2002 05:47:30 +0000 (05:47 +0000)
assuming it exists in Solaris 7 and above; nneul@umr.edu reports
that it doesn't for some kernel revision.

(cherry picked from commit d0ffec1b282518ab6d1395bfaad66f0ea8fe9feb)

acinclude.m4
src/cf/solaris-pcorefile.m4 [new file with mode: 0644]
src/rx/rx_kcommon.c

index 84dc1d612a881f409cfc5cfcf124c0f70d641708..cdbbc7a0bd20eec4eb00c47d59b0f78eed42f908 100644 (file)
@@ -153,6 +153,7 @@ case $system in
                MKAFS_OSTYPE=SOLARIS
                 AC_MSG_RESULT(sun4)
                SOLARIS_UFSVFS_HAS_DQRWLOCK
+               SOLARIS_PROC_HAS_P_COREFILE
                 ;;
         *-hpux*)
                MKAFS_OSTYPE=HPUX
diff --git a/src/cf/solaris-pcorefile.m4 b/src/cf/solaris-pcorefile.m4
new file mode 100644 (file)
index 0000000..6764e42
--- /dev/null
@@ -0,0 +1,17 @@
+AC_DEFUN(SOLARIS_PROC_HAS_P_COREFILE, [
+AC_MSG_CHECKING(for p_corefile in struct proc)
+AC_CACHE_VAL(ac_cv_solaris_proc_has_p_corefile,
+[
+AC_TRY_COMPILE(
+[#define _KERNEL
+#include <sys/proc.h>],
+[struct proc _proc;
+(void) _proc.p_corefile;], 
+ac_cv_solaris_proc_has_p_corefile=yes,
+ac_cv_solaris_proc_has_p_corefile=no)])
+AC_MSG_RESULT($ac_cv_solaris_proc_has_p_corefile)
+if test "$ac_cv_solaris_proc_has_p_corefile" = "yes"; then
+  AC_DEFINE(HAVE_P_COREFILE, 1, [define if struct proc has p_corefile])
+fi
+])
+
index e63a36e747ef80c063d7cbfc5a684add74d3bc27..a8cbde40b7f074f585d47b3d5bfc80dad0115283 100644 (file)
@@ -1064,7 +1064,7 @@ void rxk_Listener(void)
 #endif
 #ifdef AFS_SUN5_ENV
     AFS_GUNLOCK();
-#ifdef AFS_SUN57_ENV
+#ifdef HAVE_P_COREFILE
     if (!curproc->p_corefile)  /* newproc doesn't set it, but exit frees it */
        curproc->p_corefile = refstr_alloc("core");
 #endif