Gerriet M. Denkmann
Is there a way to ascertain whether a process is sleeping or awake?
There is IORegisterForSystemPower which sends seep/wake notifications but needs a runloop.
Background: I want to modify chronyd, a LaunchDaemon, which being multi-platform does not have a runloop.
The problem: between NSWorkspaceWillSleepNotification and NSWorkspaceDidWakeNotification this (as any app) will be active from time to time (every few minutes it will be active for almost a minute), which messes up the internals of chronyd.