Commit Graph

3 Commits

Author SHA1 Message Date
Corinna Vinschen de7f13aa9a Cygwin: loadavg: improve debugging of load_init
When logging in via ssh with an unprivileged account,
PdhAddEnglishCounter returns with status 0x800007D0,
PDH_CSTATUS_NO_MACHINE.  We didn't find any workaround
but the changes to improve debugging output may help
in future.  Using UNICODE instead of ANSI functions is
a result of trying to fix this problem.

Also drop the prototype workaround for PdhAddEnglishCounterA.
It's not required anymore since Mingw-w64's pdh.h catched up.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2019-03-12 17:09:42 +01:00
Corinna Vinschen 92f4e0500b Cygwin: wincap: expose more SYSTEM_INFO members and use as appropriate
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2018-04-11 11:59:35 +02:00
Jon Turney d0a359f6d2 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>
2017-03-27 22:03:58 +01:00