From: Pavel Machek <pavel@ucw.cz>
To: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Cc: kernel list <linux-kernel@vger.kernel.org>, linux-input@vger.kernel.org
Subject: Re: select() on /dev/input/eventX not level-triggered?
Date: Mon, 23 May 2011 23:20:16 +0200 [thread overview]
Message-ID: <20110523212016.GA24969@elf.ucw.cz> (raw)
In-Reply-To: <20110523204910.GA20525@core.coreip.homeip.net>
On Mon 2011-05-23 13:49:10, Dmitry Torokhov wrote:
> On Mon, May 23, 2011 at 10:06:22PM +0200, Pavel Machek wrote:
> > On Mon 2011-05-23 11:13:12, Dmitry Torokhov wrote:
> > > On Fri, May 20, 2011 at 01:50:51AM +0200, Pavel Machek wrote:
> > Difference was I'm not using non-blocking read().
>
> Does not matter.
>
> > It is unusual but
> > should work AFAICT. Just read one packet when select shows its ready;
> > if there's more than one, don't loop around read, but rely on select
> > returning immediately.
> >
> > I did verify it on strace, so it should not be python artefact.
>
> It is artefact of your program, you buffering your input. Use:
>
> file = open("/dev/input/event3", "rb", 0)
Oops, yes, you are right, that solves it. Thanks... and sorry for the
noise.
Pavel
--
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
prev parent reply other threads:[~2011-05-23 21:20 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-05-19 23:50 select() on /dev/input/eventX not level-triggered? Pavel Machek
2011-05-23 18:13 ` Dmitry Torokhov
2011-05-23 20:06 ` Pavel Machek
2011-05-23 20:49 ` Dmitry Torokhov
2011-05-23 21:20 ` Pavel Machek [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=20110523212016.GA24969@elf.ucw.cz \
--to=pavel@ucw.cz \
--cc=dmitry.torokhov@gmail.com \
--cc=linux-input@vger.kernel.org \
--cc=linux-kernel@vger.kernel.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