1 |
Marco Costa wrote: |
2 |
> Hi. |
3 |
> |
4 |
> I am trying to use inotify but something is not correct. |
5 |
> I am using gentoo 2006.0. |
6 |
> kernel: 2.6.17-gentoo-r4 |
7 |
> inotify is compiled in. |
8 |
> glibc 2.3.6-r4 |
9 |
> |
10 |
> What happens: |
11 |
> I initialize inotify, it returns the file descriptor (fd). OK |
12 |
> I add a directory to watch with all flags. It returns the watch |
13 |
> descriptor (wd). OK |
14 |
> I read (blocking) the fd. It blocks. OK |
15 |
> -> I touch a file inside the directory I am watching |
16 |
> the read unblocks, but it really returns 0 bytes read and do not block |
17 |
> anymore. |
18 |
> |
19 |
|
20 |
Problem solved. |
21 |
|
22 |
One must read all the available data at once. Reading just chunks will not work. |
23 |
The use of the ioctl FIONREAD is recommended. |
24 |
|
25 |
Regards, |
26 |
|
27 |
Marco Costa |