I have a C++ program which ends up getting run on every conceivable distro. What I can't do in C++, I can do by shelling out to the O/S. I am trying to find a portable way to send the system into hibernate and suspend modes. For users who have pm-utils, of course, I can use that, but I am trying to figure out how to do the same things when that package isn't present.
I have found a lot of Web articles that tell me to do things like:
echo -n mem > /sys/power/state
but I find that some of the virtuals I create to test contain disk mode but not mem mode or the other way around, and none of these thousands upon thousands of articles even hints at how this works.
I am willing to have my software do different things in different places and am trying to understand the basic principles, but 99.9% of the articles I read on the Web just re-quote the same two or three quick tips.
Can anyone point me towards more understanding of acpi for Linux?