Implement getloadavg()
v2: autoload PerfDataHelper functions Keep loadavg in shared memory Guard loadavg access by a mutex Initialize loadavg to the current load v3: Shared memory version bump isn't needed if we are only extending it Remove unused autoload Mark inititalized flags as NO_COPY for correct behaviour in fork child Signed-off-by: Jon Turney <jon.turney@dronecode.org.uk>
This commit is contained in:
24
winsup/cygwin/loadavg.h
Normal file
24
winsup/cygwin/loadavg.h
Normal file
@@ -0,0 +1,24 @@
|
||||
/* loadavg.h: load average support.
|
||||
|
||||
This file is part of Cygwin.
|
||||
|
||||
This software is a copyrighted work licensed under the terms of the
|
||||
Cygwin license. Please consult the file "CYGWIN_LICENSE" for
|
||||
details. */
|
||||
|
||||
#ifndef LOADAVG_H
|
||||
#define LOADAVG_H
|
||||
|
||||
class loadavginfo
|
||||
{
|
||||
double loadavg[3];
|
||||
time_t last_time;
|
||||
|
||||
public:
|
||||
void initialize ();
|
||||
int fetch (double _loadavg[], int nelem);
|
||||
void update_loadavg ();
|
||||
void calc_load (int index, int delta_time, int decay_time, double n);
|
||||
};
|
||||
|
||||
#endif /* LOADAVG_H */
|
Reference in New Issue
Block a user