Mercurial > hg > xemacs-beta
diff src/getloadavg.c @ 70:131b0175ea99 r20-0b30
Import from CVS: tag r20-0b30
author | cvs |
---|---|
date | Mon, 13 Aug 2007 09:02:59 +0200 |
parents | 56c54cf7c5b6 |
children | 6a378aca36af |
line wrap: on
line diff
--- a/src/getloadavg.c Mon Aug 13 09:00:04 2007 +0200 +++ b/src/getloadavg.c Mon Aug 13 09:02:59 2007 +0200 @@ -1,24 +1,21 @@ /* Get the system load averages. Copyright (C) 1985, 86, 87, 88, 89, 91, 92, 93, 1994, 1995 - Free Software Foundation, Inc. - -This file is part of XEmacs. + Free Software Foundation, Inc. -XEmacs is free software; you can redistribute it and/or modify it -under the terms of the GNU General Public License as published by the -Free Software Foundation; either version 2, or (at your option) any -later version. + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. -XEmacs is distributed in the hope that it will be useful, but WITHOUT -ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -for more details. + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. -You should have received a copy of the GNU General Public License -along with XEmacs; see the file COPYING. If not, write to -the Free Software Foundation, Inc., 59 Temple Place - Suite 330, -Boston, MA 02111-1307, USA. */ - + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, + USA. */ /* Compile-time symbols that this file uses: @@ -98,6 +95,7 @@ #ifndef HAVE_GETLOADAVG + /* 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 @@ -519,7 +517,9 @@ or -1 if an error occurred. */ int -getloadavg (double loadavg[], int nelem) +getloadavg (loadavg, nelem) + double loadavg[]; + int nelem; { int elem = 0; /* Return value. */ @@ -567,26 +567,6 @@ free(buf); #endif /* HAVE_KSTAT_H && HAVE_LIBKSTAT */ - -#if !defined (LDAV_DONE) && defined (HAVE_SYS_PSTAT_H) -#define LDAV_DONE - /* This is totally undocumented, and is not guaranteed to work, but - mayhap it might .... If it does work, it will work only on HP-UX - 8.0 or later. -- Darryl Okahata <darrylo@sr.hp.com> */ -#undef LOAD_AVE_TYPE /* Make sure these don't exist. */ -#undef LOAD_AVE_CVT -#undef LDAV_SYMBOL - struct pst_dynamic procinfo; - union pstun statbuf; - - statbuf.pst_dynamic = &procinfo; - if (pstat (PSTAT_DYNAMIC, statbuf, sizeof (struct pst_dynamic), 0, 0) == -1) - return (-1); - loadavg[elem++] = procinfo.psd_avg_1_min; - loadavg[elem++] = procinfo.psd_avg_5_min; - loadavg[elem++] = procinfo.psd_avg_15_min; -#endif /* HPUX */ - #endif /* XEMACS */ #if !defined (LDAV_DONE) && defined (__linux__) @@ -890,7 +870,7 @@ nl[0].n_un.n_name = LDAV_SYMBOL; nl[1].n_un.n_name = 0; #else /* not NLIST_NAME_UNION */ - nl[0].n_name = (char *) LDAV_SYMBOL; + nl[0].n_name = LDAV_SYMBOL; nl[1].n_name = 0; #endif /* not NLIST_NAME_UNION */ #endif /* NLIST_STRUCT */ @@ -1002,7 +982,9 @@ #ifdef TEST void -main (int argc, char **argv) +main (argc, argv) + int argc; + char **argv; { int naptime = 0;