sleep,hibernate and user lock,unlock events
Is it possible to programetically [using C] capture/record power events like sleep,hibernate and user lock,unlock events into a flat file.
I mean is there any such user space or kernel structure holding such data. Any such User or Kernel API?
Googled thoroughly didn't find any answers or sample code.I saw a couple of posts related to same issue, but didn't find any useful answer.
Thanks in advance for help.