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:
Jon Turney
2017-03-21 19:17:42 +00:00
parent b568f92c50
commit d0a359f6d2
11 changed files with 240 additions and 4 deletions

View File

@ -730,4 +730,9 @@ LoadDLLfunc (WSASetLastError, 4, ws2_32)
LoadDLLfunc (WSASocketW, 24, ws2_32)
// LoadDLLfunc (WSAStartup, 8, ws2_32)
LoadDLLfunc (WSAWaitForMultipleEvents, 20, ws2_32)
LoadDLLfunc (PdhAddEnglishCounterA, 16, pdh)
LoadDLLfunc (PdhCollectQueryData, 4, pdh)
LoadDLLfunc (PdhGetFormattedCounterValue, 16, pdh)
LoadDLLfunc (PdhOpenQueryA, 12, pdh)
}