使用pread和pwrite读写dev/下的设备节点没有调用llseek函数?

yuxiangyunei 2016-07-11 03:17:04
大家好,我在字符设备驱动里实现了llseek函数,在应用里lseek这个设备是有效的,我看网上的介绍
pread=lseek+read
pwrite=lseek+write
然后使用pread和pwrite操作设备节点时,发现没有调用llseek函数,但对文件操作的话是正常的
是不是pread和pwrite只能操作文件啊?有什么办法使用pread和pwrite操作设备节点时,让llseek函数也被调用到吗?
...全文
223 3 打赏 收藏 转发到动态 举报
写回复
用AI写文章
3 条回复
切换为时间正序
请发表友善的回复…
发表回复
nswcfd 2016-07-19
  • 打赏
  • 举报
回复
DESCRIPTION pread() reads up to count bytes from file descriptor fd at offset offset (from the start of the file) into the buffer starting at buf. The file offset is not changed. pwrite() writes up to count bytes from the buffer starting at buf to the file descriptor fd at offset offset. The file offset is not changed.
yuxiangyunei 2016-07-18
  • 打赏
  • 举报
回复
随便谁来个人回复下,分就是你的了
yuxiangyunei 2016-07-12
  • 打赏
  • 举报
回复
难道是我发错版块了?怎么都没人回答……

1,317

社区成员

发帖
与我相关
我的任务
社区描述
主要是开发驱动技术
社区管理员
  • 驱动程序开发区社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧