From fa11c30113115991cdc5f15042944cf5bab6eb0b Mon Sep 17 00:00:00 2001 From: Alan Coopersmith Date: Sat, 17 Feb 2024 15:21:12 -0800 Subject: unifdef __bsdi__ Signed-off-by: Alan Coopersmith --- get_load.c | 57 --------------------------------------------------------- 1 file changed, 57 deletions(-) diff --git a/get_load.c b/get_load.c index b00dfff..b801e69 100644 --- a/get_load.c +++ b/get_load.c @@ -305,58 +305,6 @@ GetLoadPoint( /* QNX NTO version */ } # else /* not __QNXNTO__ */ -# ifdef __bsdi__ -# include - -static struct nlist nl[] = { - { "_averunnable" }, -# define X_AVERUNNABLE 0 - { "_fscale" }, -# define X_FSCALE 1 - { "" }, -}; -static kvm_t *kd; -static int fscale; - -void InitLoadPoint(void) -{ - fixpt_t averunnable[3]; /* unused really */ - - if ((kd = kvm_openfiles(NULL, NULL, NULL, O_RDONLY, NULL)) == NULL) - xload_error("can't open kvm files", ""); - - if (kvm_nlist(kd, nl) != 0) - xload_error("can't read name list", ""); - - if (kvm_read(kd, (off_t)nl[X_AVERUNNABLE].n_value, (char *)averunnable, - sizeof(averunnable)) != sizeof(averunnable)) - xload_error("couldn't obtain _averunnable variable", ""); - - if (kvm_read(kd, (off_t)nl[X_FSCALE].n_value, (char *)&fscale, - sizeof(fscale)) != sizeof(fscale)) - xload_error("couldn't obtain _fscale variable", ""); - - return; -} - -void GetLoadPoint( - Widget w, /* unused */ - XtPointer closure, /* unused */ - XtPointer call_data) /* ptr to (double) return value */ -{ - double *loadavg = (double *)call_data; - fixpt_t t; - - if (kvm_read(kd, (off_t)nl[X_AVERUNNABLE].n_value, (char *)&t, - sizeof(t)) != sizeof(t)) - xload_error("couldn't obtain load average", ""); - - *loadavg = (double)t/fscale; - - return; -} - -# else /* not __bsdi__ */ # ifndef KMEM_FILE # define KMEM_FILE "/dev/kmem" # endif @@ -444,7 +392,6 @@ void GetLoadPoint( w, closure, call_data ) # endif /* or ... else */ return; } -# endif /* __bsdi__ else */ # endif /* __QNXNTO__ else */ # endif /* __APPLE__ else */ # endif /* __GNU__ else */ @@ -454,10 +401,6 @@ void GetLoadPoint( w, closure, call_data ) static void xload_error(const char *str1, const char *str2) { (void) fprintf(stderr,"xload: %s %s\n", str1, str2); -# ifdef __bsdi__ - if (kd) - kvm_close(kd); -# endif exit(-1); } -- cgit v1.2.3