Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
Linux 中有电源管理 API 吗?如果是这样,那是什么?
我希望能够对我的 C 应用程序进行编程,以防止它在运行时挂起/休眠。
谢谢,
DBusorg.freedesktop.PowerManagement在总线中提供了一些基本的电源管理功能。
org.freedesktop.PowerManagement
如果要在C程序中挂起linux系统,可以在属性文件“/sys/power/state”中写入“mem”或“disk”。写“mem”意味着挂起到ram,写“disk”意味着挂起到磁盘。