From d0ffec1b282518ab6d1395bfaad66f0ea8fe9feb Mon Sep 17 00:00:00 2001 From: Nickolai Zeldovich Date: Fri, 15 Feb 2002 05:07:13 +0000 Subject: [PATCH] Use autoconf to check for p_corefile in struct proc, rather than assuming it exists in Solaris 7 and above; nneul@umr.edu reports that it doesn't for some kernel revision. --- acinclude.m4 | 1 + src/cf/solaris-pcorefile.m4 | 17 +++++++++++++++++ src/rx/rx_kcommon.c | 2 +- 3 files changed, 19 insertions(+), 1 deletion(-) create mode 100644 src/cf/solaris-pcorefile.m4 diff --git a/acinclude.m4 b/acinclude.m4 index 000d3f0..4c96a7f 100644 --- a/acinclude.m4 +++ b/acinclude.m4 @@ -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 index 0000000..6764e42 --- /dev/null +++ b/src/cf/solaris-pcorefile.m4 @@ -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 ], +[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 +]) + diff --git a/src/rx/rx_kcommon.c b/src/rx/rx_kcommon.c index 44438e6..b888d8f 100644 --- a/src/rx/rx_kcommon.c +++ b/src/rx/rx_kcommon.c @@ -1061,7 +1061,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 -- 1.9.4