X-Git-Url: http://git.chise.org/gitweb/?a=blobdiff_plain;f=src%2Fgetloadavg.c;h=721f32bc7449d840d49d695070f83bdb339eab0a;hb=c63945cbc8551fe0313a46fe02f12233d4f2b92c;hp=b8161e49b04fa7545090e80e92ae02e3327480a3;hpb=976b002b16336930724ae22476014583ad022e7d;p=chise%2Fxemacs-chise.git- diff --git a/src/getloadavg.c b/src/getloadavg.c index b8161e4..721f32b 100644 --- a/src/getloadavg.c +++ b/src/getloadavg.c @@ -44,7 +44,6 @@ Boston, MA 02111-1307, USA. */ convex DGUX hpux - MSDOS No-op for MSDOS. NeXT sgi sequent Sequent Dynix 3.x.x (BSD) @@ -52,7 +51,7 @@ Boston, MA 02111-1307, USA. */ sony_news NEWS-OS (works at least for 4.1C) UMAX UMAX4_3 - WIN32 No-op for Windows95/NT. + WIN32_NATIVE No-op for Windows95/NT. __linux__ Linux: assumes /proc filesystem mounted. Support from Michael K. Johnson. __NetBSD__ NetBSD: assumes /kern filesystem mounted. @@ -69,8 +68,11 @@ Boston, MA 02111-1307, USA. */ #include #endif -#ifndef WINDOWSNT -#ifndef __CYGWIN32__ +#include "lisp.h" +#include "sysfile.h" /* for encapsulated open, close, read, write */ + +#ifndef WIN32_NATIVE +#ifndef CYGWIN #include @@ -81,10 +83,6 @@ Boston, MA 02111-1307, USA. */ #include #endif -#ifdef XEMACS -#include "lisp.h" -#include "sysfile.h" /* for encapsulated open, close, read, write */ -#endif /* XEMACS */ /* Exclude all the code except the test program at the end if the system has its own `getloadavg' function. @@ -94,10 +92,6 @@ Boston, MA 02111-1307, USA. */ #include -#ifndef errno -extern int errno; -#endif - #ifndef HAVE_GETLOADAVG /* The existing Emacs configuration files define a macro called @@ -114,11 +108,9 @@ extern int errno; #define LDAV_CVT(n) (LOAD_AVE_CVT (n) / 100.0) #endif -#ifdef XEMACS #if defined (HAVE_KSTAT_H) #include #endif /* HAVE_KSTAT_H */ -#endif /* XEMACS */ #if !defined (BSD) && defined (ultrix) /* Ultrix behaves like BSD on Vaxen. */ @@ -461,11 +453,9 @@ extern int errno; #include #endif -#ifdef XEMACS #if defined (HAVE_SYS_PSTAT_H) #include #endif /* HAVE_SYS_PSTAT_H (on HPUX) */ -#endif /* XEMACS */ #if defined(HAVE_FCNTL_H) || defined(_POSIX_VERSION) #include @@ -536,7 +526,7 @@ getloadavg (double loadavg[], int nelem) privileges to use it. Initial implementation courtesy Zlatko Calusic . - Integrated to XEmacs by Hrvoje Niksic . + Integrated to XEmacs by Hrvoje Niksic . Additional cleanup by Hrvoje Niksic, based on code published by Casper Dik . */ kstat_ctl_t *kc; @@ -772,31 +762,6 @@ getloadavg (double loadavg[], int nelem) loadavg[elem++] = load_info.fifteen_minute; #endif /* DGUX */ -#if !defined (LDAV_DONE) && defined (apollo) -#define LDAV_DONE -/* Apollo code from lisch@mentorg.com (Ray Lischner). - - This system call is not documented. The load average is obtained as - three long integers, for the load average over the past minute, - five minutes, and fifteen minutes. Each value is a scaled integer, - with 16 bits of integer part and 16 bits of fraction part. - - I'm not sure which operating system first supported this system call, - but I know that SR10.2 supports it. */ - - extern void proc1_$get_loadav (); - unsigned long load_ave[3]; - - proc1_$get_loadav (load_ave); - - if (nelem > 0) - loadavg[elem++] = load_ave[0] / 65536.0; - if (nelem > 1) - loadavg[elem++] = load_ave[1] / 65536.0; - if (nelem > 2) - loadavg[elem++] = load_ave[2] / 65536.0; -#endif /* apollo */ - #if !defined (LDAV_DONE) && defined (OSF_MIPS) #define LDAV_DONE @@ -808,7 +773,7 @@ getloadavg (double loadavg[], int nelem) : (load_ave.tl_avenrun.l[0] / (double) load_ave.tl_lscale)); #endif /* OSF_MIPS */ -#if !defined (LDAV_DONE) && (defined (MSDOS) || defined (WIN32)) +#if !defined (LDAV_DONE) && defined (WIN32_NATIVE) #define LDAV_DONE /* A faithful emulation is going to have to be saved for a rainy day. */ @@ -816,7 +781,7 @@ getloadavg (double loadavg[], int nelem) { loadavg[elem] = 0.0; } -#endif /* MSDOS */ +#endif /* WIN32_NATIVE */ #if !defined (LDAV_DONE) && defined (OSF_ALPHA) #define LDAV_DONE @@ -1007,4 +972,4 @@ getloadavg (double loadavg[], int nelem) } #endif /*__GNUWIN32__*/ -#endif /* WINDOWSNT */ +#endif /* WIN32_NATIVE */