检测Linux计算机中的电源事件c ++ [英] detect power events in a linux computer c++

查看:192
本文介绍了检测Linux计算机中的电源事件c ++的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我希望能够在发生这种情况时检测用户何时关闭,retsrta,注销,休眠或休眠并发送消息。我需要在c ++中这样做。如果有人可以举个例子,我会非常感激。

谢谢。

解决方案

请看这个非常一般的信息: http://events.linuxfoundation.org/sites/events/files/slides/kernel_PM_plain.pdf [ ^ ]。



你可以找到很多信息: http://bit.ly/1Ni5JXI [ ^ ]。



你需要找出你的发行版和其他一些安装的内容。这是Ubuntu的文档,以防万一: https://wiki.ubuntu.com/PowerManagement [ ^ ]。



-SA

I want to be able to detect when the user shutsdown, retsrta, logs off,sleeps or hibernates and send a message when this happens. I need to do this in c++. If someone can give me an example, I would greatly appreciate it.
Thanks.

解决方案

Please see this very general information: http://events.linuxfoundation.org/sites/events/files/slides/kernel_PM_plain.pdf[^].

You can find a lot of information: http://bit.ly/1Ni5JXI[^].

You need to find out what is installed in your distro and some other ones. This is the documentation for Ubuntu, just in case: https://wiki.ubuntu.com/PowerManagement[^].

—SA


这篇关于检测Linux计算机中的电源事件c ++的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆