diff options
author | Alan Coopersmith <alan.coopersmith@oracle.com> | 2024-02-17 15:21:12 -0800 |
---|---|---|
committer | Alan Coopersmith <alan.coopersmith@oracle.com> | 2024-02-17 15:21:12 -0800 |
commit | fa11c30113115991cdc5f15042944cf5bab6eb0b (patch) | |
tree | 751c360b2fc71cffba6b0f146a5a43ad69b6a455 /get_load.c | |
parent | f15b8097a00299291263cfe64947942564ccc373 (diff) |
unifdef __bsdi__
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Diffstat (limited to 'get_load.c')
-rw-r--r-- | get_load.c | 57 |
1 files changed, 0 insertions, 57 deletions
@@ -305,58 +305,6 @@ GetLoadPoint( /* QNX NTO version */ } # else /* not __QNXNTO__ */ -# ifdef __bsdi__ -# include <kvm.h> - -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); } |