X-Git-Url: https://code.delx.au/gnu-emacs/blobdiff_plain/4ffd0d6b569d252e4e807d4e9c9d6a5bd5b08640..8142fc97af742e083fb83e4d0470da59b123a467:/lib/getloadavg.c diff --git a/lib/getloadavg.c b/lib/getloadavg.c index d324451ef1..0cbca265b2 100644 --- a/lib/getloadavg.c +++ b/lib/getloadavg.c @@ -1,6 +1,6 @@ /* Get the system load averages. - Copyright (C) 1985-1989, 1991-1995, 1997, 1999-2000, 2003-2011 Free Software + Copyright (C) 1985-1989, 1991-1995, 1997, 1999-2000, 2003-2015 Free Software Foundation, Inc. NOTE: The canonical source of this file is maintained with gnulib. @@ -28,7 +28,7 @@ macro that comes with autoconf 2.13 or newer. If that isn't an option, then just put AC_CHECK_FUNCS(pstat_getdynamic) in your - configure.in file. + configure.ac file. HAVE_LIBPERFSTAT Define this if your system has the perfstat_cpu_total function in libperfstat (AIX). FIXUP_KERNEL_SYMBOL_ADDR() Adjust address in returned struct nlist. @@ -46,7 +46,7 @@ NLIST_STRUCT Include nlist.h, not a.out.h. N_NAME_POINTER The nlist n_name element is a pointer, not an array. - HAVE_STRUCT_NLIST_N_UN_N_NAME `n_un.n_name' is member of `struct nlist'. + HAVE_STRUCT_NLIST_N_UN_N_NAME 'n_un.n_name' is member of 'struct nlist'. LINUX_LDAV_FILE [__linux__, __CYGWIN__]: File containing load averages. @@ -80,45 +80,23 @@ We also #define LDAV_PRIVILEGED if a program will require special installation to be able to call getloadavg. */ -/* "configure" defines CONFIGURING_GETLOADAVG to sidestep problems - with partially-configured source directories. */ - -#ifndef CONFIGURING_GETLOADAVG -# include -# include -#endif +#include /* Specification. */ #include #include +#include #include # include -/* Both the Emacs and non-Emacs sections want this. Some - configuration files' definitions for the LOAD_AVE_CVT macro (like - sparc.h's) use macros like FSCALE, defined here. */ -# if defined (unix) || defined (__unix) +# if HAVE_SYS_PARAM_H # include # endif # include "intprops.h" -/* The existing Emacs configuration files define a macro called - LOAD_AVE_CVT, which accepts a value of type LOAD_AVE_TYPE, and - returns the load average multiplied by 100. What we actually want - is a macro called LDAV_CVT, which returns the load average as an - unmultiplied double. - - For backwards compatibility, we'll define LDAV_CVT in terms of - LOAD_AVE_CVT, but future machine config files should just define - LDAV_CVT directly. */ - -# if !defined (LDAV_CVT) && defined (LOAD_AVE_CVT) -# define LDAV_CVT(n) (LOAD_AVE_CVT (n) / 100.0) -# endif - # if !defined (BSD) && defined (ultrix) /* Ultrix behaves like BSD on Vaxen. */ # define BSD @@ -794,7 +772,7 @@ getloadavg (double loadavg[], int nelem) # define LDAV_DONE /* This call can return -1 for an error, but with good args it's not supposed to fail. The first argument is for no - apparent reason of type `long int *'. */ + apparent reason of type 'long int *'. */ dg_sys_info ((long int *) &load_info, DG_SYS_INFO_LOAD_INFO_TYPE, DG_SYS_INFO_LOAD_VERSION_0);