public inbox for gentoo-user@lists.gentoo.org
 help / color / mirror / Atom feed
From: Marco Costa <costa@gamic.com>
To: gentoo-user@lists.gentoo.org
Subject: [gentoo-user]  Re: inotify problem - SOLVED
Date: Tue, 22 Aug 2006 11:51:23 +0200	[thread overview]
Message-ID: <5m0rr3-6h5.ln1@legba.gamic.com> (raw)
In-Reply-To: <9srgr3-n5s.ln1@legba.gamic.com>

[-- Attachment #1: Type: text/plain, Size: 739 bytes --]

Marco Costa wrote:
> Hi.
> 
> I am trying to use inotify but something is not correct.
> I am using gentoo 2006.0.
> kernel:  2.6.17-gentoo-r4
>  inotify is compiled in.
> glibc 2.3.6-r4
> 
> What happens:
> I initialize inotify, it returns the file descriptor (fd). OK
> I add a directory to watch with all flags. It returns the watch
> descriptor (wd). OK
> I read (blocking) the fd. It blocks. OK
> -> I touch a file inside the directory I am watching
> the read unblocks, but it really returns 0 bytes read and do not block
> anymore.
> 

Problem solved.

One must read all the available data at once. Reading just chunks will not work.
The use of the ioctl FIONREAD is recommended.

Regards,

Marco Costa


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 189 bytes --]

      reply	other threads:[~2006-08-22 10:16 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-08-18 13:28 [gentoo-user] inotify problem Marco Costa
2006-08-22  9:51 ` Marco Costa [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5m0rr3-6h5.ln1@legba.gamic.com \
    --to=costa@gamic.com \
    --cc=gentoo-user@lists.gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox