diff options
author | Alan Coopersmith <alan.coopersmith@oracle.com> | 2024-02-11 15:39:43 -0800 |
---|---|---|
committer | Alan Coopersmith <alan.coopersmith@oracle.com> | 2024-02-11 16:05:12 -0800 |
commit | fe24c5e19d4d309b4f3a3e435b9d834836312301 (patch) | |
tree | 9405929df699e247f6283a348c68022274e78f04 /get_load.c | |
parent | 7c97025b18baf00c81319c7a01120bd6417fdadf (diff) |
unifdef SVR4
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Diffstat (limited to 'get_load.c')
-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 */ |