当前位置: 首页 > article >正文

Linux: 文档 :相关接口文档手册还是需要仔细阅读

接口文档的阅读,一定要仔细。最近遇到一个问题,明明文档里有说,read函数读取到的是一个或者多个events,但是代码里依然按照一个来处理。就会导致漏event的可能。漏了event,后续的逻辑就会受影响。
Each successful read(2) returns a buffer containing one or more of the following

structures:
           struct inotify_event {
               int      wd;       /* Watch descriptor */
               uint32_t mask;     /* Mask describing event */
               uint32_t cookie;   /* Unique cookie associating related
                                     events (for rename(2)) */
               uint32_t len;      /* Size of name field */
               char     name[];   /* Optional null-terminated name */
           };

wd identifies the watch for which this event occurs. It is one of the watch descriptors returned by a previous call to inotify_add_watch(2).

这种读文档不仔细的例子,之前还碰到过一两次。有可能大家只是用,从来不读帮助手册,这是不可取的。


http://www.kler.cn/news/157589.html

相关文章:

  • mfc 设置excel 单元格的列宽
  • EM32DX-C4【C#】
  • 解决:ERROR: No matching distribution found for rarfile
  • 传输层可靠传输的原理
  • 【网络安全技术】密钥管理
  • llama.cpp部署(windows)
  • LinuxBasicsForHackers笔记 --添加和删​​除软件
  • Notepad++ 安装TextFx插件失败
  • 双目光波导AR眼镜_AR智能眼镜主板PCB定制开发
  • 探讨Unity中的动画融合技术(BlendTree)
  • <Linux>(极简关键、省时省力)《Linux操作系统原理分析之linux存储管理(5)》(21)
  • C#的方法使用
  • C++数据结构:B树
  • C10练习题
  • 分享几个电视颜色测试图形卡
  • JVM类加载全过程
  • 2023-2024-1-高级语言程序设计-第2次月考函数题
  • 【C语言】预处理详解
  • js获取当前时间,当日零点,前一周时间
  • Web测试自动化工具Selenium的使用
  • Java中熟练掌握BigDecimal运用-工具类
  • netcore swagger 错误 Failed to load API definition
  • 【开源】基于Vue+SpringBoot的康复中心管理系统
  • 【Unity动画】Unity 动画播放的流程
  • Python处理Point, MultiPolygon, Polygon, LineString等Geo地理形状数据
  • 根据已有安装的cuda配置合适的pytorch环境
  • vue:ESLint如何自动修复代码
  • IntelliJ IDEA的下载安装配置步骤详解
  • 开源堡垒机Jumpserver
  • 人工智能|网络爬虫——用Python爬取电影数据并可视化分析