diff options
-rw-r--r-- | get_load.c | 35 |
1 files changed, 6 insertions, 29 deletions
@@ -142,15 +142,6 @@ void GetLoadPoint( # include <sys/param.h> # endif - - -# ifdef SVR4 -# ifndef FSCALE -# define FSCALE (1 << 8) -# endif -# endif - - # if defined(linux) || (defined(__FreeBSD_kernel__) && defined(__GLIBC__)) void InitLoadPoint(void) @@ -395,9 +386,6 @@ void GetLoadPoint( /* * provide default for everyone else */ -# ifdef SVR4 -# define KERNEL_FILE "/stand/unix" -# else /* If a BSD system, check in <paths.h> */ # ifdef BSD # include <paths.h> @@ -413,28 +401,17 @@ void GetLoadPoint( # else /* BSD */ # define KERNEL_FILE "/vmunix" # endif /* BSD */ -# endif /* SVR4 */ # endif /* KERNEL_FILE */ # ifndef KERNEL_LOAD_VARIABLE # if defined(BSD) && (BSD >= 199103) # define KERNEL_LOAD_VARIABLE "_averunnable" +# else /* BSD >= 199103 */ +# define KERNEL_LOAD_VARIABLE "_avenrun" # endif /* BSD >= 199103 */ # endif /* KERNEL_LOAD_VARIABLE */ -/* - * provide default for everyone else - */ - -# ifndef KERNEL_LOAD_VARIABLE -# ifdef SVR4 -# define KERNEL_LOAD_VARIABLE "avenrun" -# else -# define KERNEL_LOAD_VARIABLE "_avenrun" -# endif -# endif /* KERNEL_LOAD_VARIABLE */ - static struct nlist namelist[] = { /* namelist for vmunix grubbing */ # define LOADAV 0 {KERNEL_LOAD_VARIABLE}, @@ -446,7 +423,7 @@ static long loadavg_seek; void InitLoadPoint() { -# if !defined(SVR4) && !defined(AIXV5) && !(BSD >= 199103) && !defined(__APPLE__) +# if !defined(AIXV5) && !(BSD >= 199103) && !defined(__APPLE__) extern void nlist(); # endif @@ -477,15 +454,15 @@ void GetLoadPoint( w, closure, call_data ) (void) lseek(kmem, loadavg_seek, 0); -# if defined(SVR4) || (BSD >= 199103) +# if (BSD >= 199103) { long temp; (void) read(kmem, (char *)&temp, sizeof(long)); *loadavg = (double)temp/FSCALE; } -# else /* else not SVR4 or BSD */ +# else /* else not BSD */ (void) read(kmem, (char *)loadavg, sizeof(double)); -# endif /* SVR4 or ... else */ +# endif /* or ... else */ return; } # endif /* __bsdi__ else */ |