<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[【FAQ】全志V853芯片 如何解决getevent运行出错，报错为“could not add watch for &#x2F;dev&#x2F;input”的问题？]]></title><description><![CDATA[<h3><strong>一、问题背景</strong></h3>
<p dir="auto">如果系统已经注册了input设备，想要使用getevent命令去获取input事件时，发现getevent运行会报错，不能正常运行。</p>
<p dir="auto">报错信息为：could not add watch for /dev/input, Function not implemented</p>
<p dir="auto">如下图所示：</p>
<p dir="auto"><img src="/assets/uploads/files/1655362779324-6e6c9fc2f9634f57a869062ed47e3f06.jfif" alt="6e6c9fc2f9634f57a869062ed47e3f06.jfif" class=" img-responsive img-markdown" width="undefined" height="undefined" /></p>
<h3><strong>二、问题分析</strong></h3>
<p dir="auto">通过小机端目录/dev/input/下，发现是有event*的，证明是已经注册有input设备了，有input设备getevent就可以正常运行。</p>
<p dir="auto">通过getevent源码得知，"could not add watch"的错误是由于运行函数inotify_add_watch()，获取不到所对应的inotify的watch而产生的。</p>
<p dir="auto"><img src="/assets/uploads/files/1655362786158-ab1eecf8885c4e918ff36c1fcc614a08.jfif" alt="ab1eecf8885c4e918ff36c1fcc614a08.jfif" class=" img-responsive img-markdown" width="undefined" height="undefined" /></p>
<p dir="auto">inotify是一个内核用于通知用户空间程序文件系统变化的机制，现在获取不到inotify可以判断为内核空间没有给到用户空间权限或者是接口。</p>
<p dir="auto">内核空间是有对应的配置使能用户空间的接口的，选上该配置，即可解决问题。</p>
<p dir="auto"><img src="/assets/uploads/files/1655362792378-3776606cab8d41df900dffe6b6be8351.jfif" alt="3776606cab8d41df900dffe6b6be8351.jfif" class=" img-responsive img-markdown" width="undefined" height="undefined" /></p>
<p dir="auto">PS：另外，使用cat /dev/input/event* | hexdump -C 也可以获取input事件。</p>
]]></description><link>https://bbs.aw-ol.com/topic/1616/faq-全志v853芯片-如何解决getevent运行出错-报错为-could-not-add-watch-for-dev-input-的问题</link><generator>RSS for Node</generator><lastBuildDate>Tue, 19 May 2026 19:37:37 GMT</lastBuildDate><atom:link href="https://bbs.aw-ol.com/topic/1616.rss" rel="self" type="application/rss+xml"/><pubDate>Thu, 16 Jun 2022 07:05:33 GMT</pubDate><ttl>60</ttl></channel></rss>