在我的(嵌入式)系统上,我有多个看门狗字符设备:
# ls -al /dev/watchdog*
crw------- 1 imp root 10, 130 Apr 26 07:43 /dev/watchdog
crw------- 1 root root 253, 0 Apr 26 07:44 /dev/watchdog0
crw------- 1 root root 253, 1 Apr 26 07:44 /dev/watchdog1
# dmesg | grep -i watchdog
[ 2.342104] omap_wdt: OMAP Watchdog Timer Rev 0x01: initial timeout 60 sec
[ 6.713125] softdog: Software Watchdog Timer: 0.08 initialized. soft_noboot=0 soft_margin=120 sec soft_panic=0 (nowayout=1)
Run Code Online (Sandbox Code Playgroud)
我很确定这/dev/watchdog0是硬件看门狗和/dev/watchdog1软件看门狗,但为什么还有一个/dev/watchdog?
背景:软件看门狗配置了nowayout标志,因此,一旦被馈送,它就不会再停止,直到重新启动。但是,写入/dev/watchdog似乎并没有触发软件看门狗,也没有给我重要的nowayout功能。我可以/dev/watchdog1直接使用,但是我需要一些可靠的方法来识别正确的软件看门狗设备文件名......