From ab9db56291d49b0002fb69db44e24b1ccff4445b Mon Sep 17 00:00:00 2001 From: codemastr Date: Sat, 10 Nov 2001 18:13:05 +0000 Subject: [PATCH] Added support for PS_STRINGS and pstat --- Changes | 2 + autoconf/configure.in | 9 +- configure | 248 ++++++++++++++++++++++++++++-------------- include/setup.h.in | 6 + src/ircd.c | 17 ++- src/socket.c | 2 +- 6 files changed, 196 insertions(+), 88 deletions(-) diff --git a/Changes b/Changes index 98bdf1fe8..475bf9a26 100644 --- a/Changes +++ b/Changes @@ -915,3 +915,5 @@ seen. gmtime warning still there - Made the /kline hostmask checker work like the G:line checker, (it was too easy to K:line *@*) - Fixed a bug where ./unreal rehash would kill the IRCd instead of rehashing :P - Made ./unreal restart (to restart Unreal) and made the pid file location more accurate +- Added support for PS_STRINGS and pstat to change the progrma name (couldn't test since I don't have an OS + that uses them) diff --git a/autoconf/configure.in b/autoconf/configure.in index e3f6a1967..bb4bb2d57 100644 --- a/autoconf/configure.in +++ b/autoconf/configure.in @@ -228,8 +228,13 @@ fi AC_FUNC_VPRINTF AC_CHECK_FUNCS(gettimeofday,AC_DEFINE(GETTIMEOFDAY),[AC_CHECK_FUNCS(lrand48,AC_DEFINE(LRADN48))]) AC_CHECK_FUNCS(getrusage,AC_DEFINE(GETRUSAGE_2),[AC_CHECK_FUNCS(times,AC_DEFINE(TIMES_2))]) -AC_CHECK_FUNCS(setproctitle,AC_DEFINE(HAVE_SETPROCTITLE)) -AC_CHECK_LIB(util,setproctitle,AC_DEFINE(HAVE_SETPROCTITLE) IRCDLIBS="$IRCDLIBS-lutil") +AC_CHECK_FUNCS(setproctitle,AC_DEFINE(HAVE_SETPROCTITLE),[ +AC_CHECK_LIB(util,setproctitle,AC_DEFINE(HAVE_SETPROCTITLE) IRCDLIBS="$IRCDLIBS-lutil",[ +AC_EGREP_HEADER([#define.*PS_STRINGS.*],sys/exec.h,AC_DEFINE(HAVE_PSSTRINGS),[ +AC_CHECK_FUNCS(pstat,AC_DEFINE(HAVE_PSTAT)) +]) +]) +]) AC_CACHE_CHECK(what type of signals you have, ac_cv_sigtype, [ AC_TRY_RUN([ #include diff --git a/configure b/configure index eae9cdd27..4db110a59 100755 --- a/configure +++ b/configure @@ -3224,11 +3224,8 @@ EOF else echo "$ac_t""no" 1>&6 -fi -done - echo $ac_n "checking for setproctitle in -lutil""... $ac_c" 1>&6 -echo "configure:3232: checking for setproctitle in -lutil" >&5 +echo "configure:3229: checking for setproctitle in -lutil" >&5 ac_lib_var=`echo util'_'setproctitle | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -3236,7 +3233,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lutil $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3248: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -3268,10 +3265,93 @@ EOF IRCDLIBS="$IRCDLIBS-lutil" else echo "$ac_t""no" 1>&6 + +cat > conftest.$ac_ext < +EOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + egrep "#define.*PS_STRINGS.*" >/dev/null 2>&1; then + rm -rf conftest* + cat >> confdefs.h <<\EOF +#define HAVE_PSSTRINGS 1 +EOF + +else + rm -rf conftest* + +for ac_func in pstat +do +echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 +echo "configure:3288: checking for $ac_func" >&5 +if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext < +/* Override any gcc2 internal prototype to avoid an error. */ +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char $ac_func(); + +int main() { + +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined (__stub_$ac_func) || defined (__stub___$ac_func) +choke me +#else +$ac_func(); +#endif + +; return 0; } +EOF +if { (eval echo configure:3316: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + eval "ac_cv_func_$ac_func=yes" +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_func_$ac_func=no" fi - +rm -f conftest* +fi + +if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then + echo "$ac_t""yes" 1>&6 + ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` + cat >> confdefs.h <> confdefs.h <<\EOF +#define HAVE_PSTAT 1 +EOF + +else + echo "$ac_t""no" 1>&6 +fi +done + + +fi +rm -f conftest* + + +fi + + +fi +done + echo $ac_n "checking what type of signals you have""... $ac_c" 1>&6 -echo "configure:3275: checking what type of signals you have" >&5 +echo "configure:3355: checking what type of signals you have" >&5 if eval "test \"`echo '$''{'ac_cv_sigtype'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -3280,7 +3360,7 @@ if test "$cross_compiling" = yes; then { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; } else cat > conftest.$ac_ext < @@ -3289,7 +3369,7 @@ sigaction(SIGTERM, (struct sigaction *)0L, (struct sigaction *)0L); } EOF -if { (eval echo configure:3293: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:3373: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then ac_cv_sigtype=POSIX else @@ -3301,7 +3381,7 @@ if test "$cross_compiling" = yes; then { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; } else cat > conftest.$ac_ext < @@ -3322,7 +3402,7 @@ exit(0); } EOF -if { (eval echo configure:3326: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:3406: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then ac_cv_sigtype=BSD else @@ -3361,12 +3441,12 @@ fi for ac_func in strtoken do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:3365: checking for $ac_func" >&5 +echo "configure:3445: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3473: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -3420,12 +3500,12 @@ done for ac_func in strtok do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:3424: checking for $ac_func" >&5 +echo "configure:3504: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3532: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -3479,12 +3559,12 @@ done for ac_func in strerror do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:3483: checking for $ac_func" >&5 +echo "configure:3563: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3591: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -3538,12 +3618,12 @@ done for ac_func in index do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:3542: checking for $ac_func" >&5 +echo "configure:3622: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3650: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -3597,12 +3677,12 @@ done for ac_func in strtoul do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:3601: checking for $ac_func" >&5 +echo "configure:3681: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3709: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -3653,12 +3733,12 @@ done for ac_func in bcopy do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:3657: checking for $ac_func" >&5 +echo "configure:3737: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3765: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -3712,12 +3792,12 @@ done for ac_func in bcmp do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:3716: checking for $ac_func" >&5 +echo "configure:3796: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3824: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -3771,12 +3851,12 @@ done for ac_func in bzero do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:3775: checking for $ac_func" >&5 +echo "configure:3855: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3883: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -3830,12 +3910,12 @@ done for ac_func in strcasecmp do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:3834: checking for $ac_func" >&5 +echo "configure:3914: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3942: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -3888,12 +3968,12 @@ done for ac_func in inet_addr do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:3892: checking for $ac_func" >&5 +echo "configure:3972: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4000: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -3947,12 +4027,12 @@ done for ac_func in inet_ntoa do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:3951: checking for $ac_func" >&5 +echo "configure:4031: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4059: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -4006,12 +4086,12 @@ done for ac_func in inet_netof do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:4010: checking for $ac_func" >&5 +echo "configure:4090: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4118: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -4259,7 +4339,7 @@ cat >> confdefs.h <<\EOF EOF echo $ac_n "checking what order we should supply the SSL libraries in""... $ac_c" 1>&6 -echo "configure:4263: checking what order we should supply the SSL libraries in" >&5 +echo "configure:4343: checking what order we should supply the SSL libraries in" >&5 if eval "test \"`echo '$''{'ac_cv_ssl_libs'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -4267,7 +4347,7 @@ else save_libs="$LIBS" LIBS="$LIBS -lssl -lcrypto -lssl" cat > conftest.$ac_ext < int main() { @@ -4276,7 +4356,7 @@ SSL_write(NULL, NULL, NULL); ; return 0; } EOF -if { (eval echo configure:4280: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4360: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* ac_cv_ssl_libs="-lssl -lcrypto -lssl" LIBS="$save_libs" else @@ -4302,12 +4382,12 @@ if test "${enable_dynamic_linking+set}" = set; then enableval="$enable_dynamic_linking" echo $ac_n "checking for dlopen""... $ac_c" 1>&6 -echo "configure:4306: checking for dlopen" >&5 +echo "configure:4386: checking for dlopen" >&5 if eval "test \"`echo '$''{'ac_cv_func_dlopen'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4414: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_dlopen=yes" else @@ -4348,7 +4428,7 @@ if eval "test \"`echo '$ac_cv_func_'dlopen`\" = yes"; then else echo "$ac_t""no" 1>&6 echo $ac_n "checking for dlopen in -ldl""... $ac_c" 1>&6 -echo "configure:4352: checking for dlopen in -ldl" >&5 +echo "configure:4432: checking for dlopen in -ldl" >&5 ac_lib_var=`echo dl'_'dlopen | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -4356,7 +4436,7 @@ else ac_save_LIBS="$LIBS" LIBS="-ldl $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4451: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -4396,20 +4476,20 @@ fi hold_cflags=$CFLAGS CFLAGS="$CFLAGS -export-dynamic" echo $ac_n "checking if we need the -export-dynamic flag""... $ac_c" 1>&6 -echo "configure:4400: checking if we need the -export-dynamic flag" >&5 +echo "configure:4480: checking if we need the -export-dynamic flag" >&5 if eval "test \"`echo '$''{'ac_cv_export_dynamic'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4493: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* ac_cv_export_dynamic=yes else @@ -4427,7 +4507,7 @@ CFLAGS=$hold_cflags fi echo $ac_n "checking for compiler option to produce PIC""... $ac_c" 1>&6 -echo "configure:4431: checking for compiler option to produce PIC" >&5 +echo "configure:4511: checking for compiler option to produce PIC" >&5 if eval "test \"`echo '$''{'ac_cv_pic'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -4463,7 +4543,7 @@ if test "${enable_inet6+set}" = set; then enableval="$enable_inet6" echo $ac_n "checking if your system has IPv6 support""... $ac_c" 1>&6 -echo "configure:4467: checking if your system has IPv6 support" >&5 +echo "configure:4547: checking if your system has IPv6 support" >&5 if eval "test \"`echo '$''{'ac_cv_ip6'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -4472,7 +4552,7 @@ if test "$cross_compiling" = yes; then { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; } else cat > conftest.$ac_ext < @@ -4484,7 +4564,7 @@ exit(0); } EOF -if { (eval echo configure:4488: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:4568: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then ac_cv_ip6=yes else @@ -4546,7 +4626,7 @@ else { echo "configure: error: can not run $ac_config_sub" 1>&2; exit 1; } fi echo $ac_n "checking host system type""... $ac_c" 1>&6 -echo "configure:4550: checking host system type" >&5 +echo "configure:4630: checking host system type" >&5 host_alias=$host case "$host_alias" in @@ -4572,17 +4652,17 @@ acx_pthread_ok=no # If it isn't, don't bother looking for the threads libraries. ac_safe=`echo "pthread.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for pthread.h""... $ac_c" 1>&6 -echo "configure:4576: checking for pthread.h" >&5 +echo "configure:4656: checking for pthread.h" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:4586: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:4666: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -4651,7 +4731,7 @@ esac result=none if test "$acx_pthread_ok" = "no"; then echo $ac_n "checking what flags pthreads needs""... $ac_c" 1>&6 -echo "configure:4655: checking what flags pthreads needs" >&5 +echo "configure:4735: checking what flags pthreads needs" >&5 if eval "test \"`echo '$''{'ac_cv_pthreadflag'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -4689,7 +4769,7 @@ for flag in $acx_pthread_flags; do # functions on Solaris that doesn't have a non-functional libc stub. # We try pthread_create on general principles. cat > conftest.$ac_ext < int main() { @@ -4698,7 +4778,7 @@ pthread_t th; pthread_join(th, 0); pthread_create(0,0,0,0); pthread_cleanup_pop(0); ; return 0; } EOF -if { (eval echo configure:4702: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4782: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* acx_pthread_ok=yes else @@ -4744,20 +4824,20 @@ esac # Detect AIX lossage: threads are created detached by default # and the JOINABLE attribute has a nonstandard name (UNDETACHED). echo $ac_n "checking for joinable pthread attribute""... $ac_c" 1>&6 -echo "configure:4748: checking for joinable pthread attribute" >&5 +echo "configure:4828: checking for joinable pthread attribute" >&5 if eval "test \"`echo '$''{'ac_cv_pthreadjoin'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < int main() { int attr=PTHREAD_CREATE_JOINABLE; ; return 0; } EOF -if { (eval echo configure:4761: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4841: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* ac_cv_pthreadjoin=PTHREAD_CREATE_JOINABLE else @@ -4769,14 +4849,14 @@ fi rm -f conftest* if test "$ac_cv_pthreadjoin" = "unknown"; then cat > conftest.$ac_ext < int main() { int attr=PTHREAD_CREATE_UNDETACHED; ; return 0; } EOF -if { (eval echo configure:4780: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4860: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* ac_cv_pthreadjoin=PTHREAD_CREATE_UNDETACHED else @@ -4802,7 +4882,7 @@ EOF fi echo $ac_n "checking if more special flags are required for pthreads""... $ac_c" 1>&6 -echo "configure:4806: checking if more special flags are required for pthreads" >&5 +echo "configure:4886: checking if more special flags are required for pthreads" >&5 if eval "test \"`echo '$''{'ac_cv_pthreadspecial'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -4827,7 +4907,7 @@ echo "$ac_t""$ac_cv_pthreadspecial" 1>&6 # Extract the first word of "cc_r", so it can be a program name with args. set dummy cc_r; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:4831: checking for $ac_word" >&5 +echo "configure:4911: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_PTHREAD_CC'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -4859,7 +4939,7 @@ else fi if test "x$ac_cv_pthreadflag"!=x; then echo $ac_n "checking if pthreads uses one thread per process""... $ac_c" 1>&6 -echo "configure:4863: checking if pthreads uses one thread per process" >&5 +echo "configure:4943: checking if pthreads uses one thread per process" >&5 if eval "test \"`echo '$''{'ac_cv_thread_multi'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -4872,7 +4952,7 @@ if test "$cross_compiling" = yes; then { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; } else cat > conftest.$ac_ext < @@ -4906,7 +4986,7 @@ int main() { } EOF -if { (eval echo configure:4910: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:4990: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then ac_cv_thread_multi=no else @@ -4982,12 +5062,12 @@ CC="$PTHREAD_CC" CFLAGS="$CFLAGS $PTHREAD_CFLAGS" IRCDLIBS="$IRCDLIBS $PTHREAD_LIBS" echo $ac_n "checking if FD_SETSIZE is large enough to allow $ac_fd file descriptors""... $ac_c" 1>&6 -echo "configure:4986: checking if FD_SETSIZE is large enough to allow $ac_fd file descriptors" >&5 +echo "configure:5066: checking if FD_SETSIZE is large enough to allow $ac_fd file descriptors" >&5 if test "$cross_compiling" = yes; then { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; } else cat > conftest.$ac_ext < @@ -4999,7 +5079,7 @@ exit(1); } EOF -if { (eval echo configure:5003: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:5083: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then echo "$ac_t""yes" 1>&6 else diff --git a/include/setup.h.in b/include/setup.h.in index c4a69816d..215de763c 100644 --- a/include/setup.h.in +++ b/include/setup.h.in @@ -168,6 +168,12 @@ /* Define if you have setproctitle */ #undef HAVE_SETPROCTITLE +/* Define if you have PS_STRINGS */ +#undef HAVE_PSSTRINGS + +/* Define if you have pstat */ +#undef HAVE_PSTAT + /* Local hostname of the server */ #undef DOMAINNAME diff --git a/src/ircd.c b/src/ircd.c index 9ae107efd..32fd3dcd6 100644 --- a/src/ircd.c +++ b/src/ircd.c @@ -52,6 +52,12 @@ Computing Center and Jarkko Oikarinen"; #undef _KERNEL #endif #include +#ifdef HAVE_PSSTRINGS +#include +#endif +#ifdef HAVE_PSTAT +#include +#endif #include "h.h" #ifndef NO_FDLIST #include "fdlist.h" @@ -782,6 +788,9 @@ int InitwIRCD(argc, argv) #else uid_t uid, euid; TS delay = 0; +#endif +#ifdef HAVE_PSTAT + union pstun pstats; #endif int i, ggg; int portarg = 0; @@ -1162,8 +1171,14 @@ int InitwIRCD(argc, argv) #endif SetupEvents(); loop.ircd_booted = 1; -#ifdef HAVE_SETPROCTITLE +#if defined(HAVE_SETPROCTITLE) setproctitle("%s", me.name); +#elif defined(HAVE_PSTAT) + pstats.pst_command = me.name; + pstat(PSTAT_SETCMD, pstats, strlen(me.name), 0, 0); +#elif defined(HAVE_PSSTRINGS) + PS_STRINGS->ps_nargvstr = 1; + PS_STRINGS->ps_argvstr = me.name; #endif module_loadall(); #ifdef STATIC_LINKING diff --git a/src/socket.c b/src/socket.c index 01c0513f1..82d78527a 100644 --- a/src/socket.c +++ b/src/socket.c @@ -207,7 +207,7 @@ char *Inet_ia2p(struct IN_ADDR *ia) { static char buf[256]; #ifndef INET6 - return(inet_ntoa(*ia)); + return (inet_ntoa(*ia)); #else /* Hack to make proper addresses */ u_char *cp;