看板 LinuxDev 關於我們 聯絡資訊
請問各位兩個問題 1. select可以用在檔案嗎?例如test.txt,我用了無法使用,select是不是要用在字元裝置才行 2. inotify可以用在pseudo filesytem嗎?我想監控eth0中carrier,carrier內容有發生變動,但是inotify卻沒有反應 謝謝各位版友解惑 -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 118.161.40.154
cobrasgo:可以吧,你有open test.txt然後得到fd嗎? 03/09 20:47
cobrasgo:等等,我是從邏輯上猜的,沒驗證過,請強者回答 03/09 20:48
yuskeb:第二個問題在下面FAQ裡有喔 請問你使用的kernel版本是? 03/11 22:58
yuskeb:http://ppt.cc/e!GL 03/11 22:59
yuskeb:Q: Can I watch sysfs (procfs, nfs...)? 03/11 23:00
yuskeb:Simply spoken: yes, but with some limitations. 03/11 23:00
yuskeb:These limitations vary between kernel versions and tend 03/11 23:01
yuskeb: to get smaller. 03/11 23:01
yuskeb:Please read information about particular filesystems. 03/11 23:01
yuskeb:另外檢查看看 "cat /proc/filesystems | grep inotifyfs" 03/11 23:06
swh:謝謝yuskeb,我的kernel是2.6.35.6,我在研究看看好了 03/12 13:18
swh:有提到好像不支援>< 03/12 13:19
swh:問題一,我其實是想用select監控carrier的變化,不過select好 03/12 13:20
swh:像不能用,我用read select結果一直被觸發,想問一下監控carri 03/12 13:22
swh:er除了使用poll的方式,還有沒有比較聰明的方法 03/12 13:23