作者swh (路人甲)
看板LinuxDev
标题[问题] 问select与inotify两个问题
时间Fri Mar 9 16:38:12 2012
请问各位两个问题
1. select可以用在档案吗?例如test.txt,我用了无法使用,select是不是要用在字元装置才行
2. inotify可以用在pseudo filesytem吗?我想监控eth0中carrier,carrier内容有发生变动,但是inotify却没有反应
谢谢各位版友解惑
--
※ 发信站: 批踢踢实业坊(ptt.cc)
◆ From: 118.161.40.154
1F:→ cobrasgo:可以吧,你有open test.txt然後得到fd吗? 03/09 20:47
2F:→ cobrasgo:等等,我是从逻辑上猜的,没验证过,请强者回答 03/09 20:48
3F:推 yuskeb:第二个问题在下面FAQ里有喔 请问你使用的kernel版本是? 03/11 22:58
5F:→ yuskeb:Q: Can I watch sysfs (procfs, nfs...)? 03/11 23:00
6F:→ yuskeb:Simply spoken: yes, but with some limitations. 03/11 23:00
7F:→ yuskeb:These limitations vary between kernel versions and tend 03/11 23:01
8F:→ yuskeb: to get smaller. 03/11 23:01
9F:→ yuskeb:Please read information about particular filesystems. 03/11 23:01
10F:推 yuskeb:另外检查看看 "cat /proc/filesystems | grep inotifyfs" 03/11 23:06
11F:→ swh:谢谢yuskeb,我的kernel是2.6.35.6,我在研究看看好了 03/12 13:18
13F:→ swh:有提到好像不支援>< 03/12 13:19
14F:→ swh:问题一,我其实是想用select监控carrier的变化,不过select好 03/12 13:20
15F:→ swh:像不能用,我用read select结果一直被触发,想问一下监控carri 03/12 13:22
16F:→ swh:er除了使用poll的方式,还有没有比较聪明的方法 03/12 13:23