mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Eric Dumazet <eric.dumazet@gmail.com>
To: Davide Libenzi <davidel@xmailserver.org>
Cc: Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	Andrew Morton <akpm@linux-foundation.org>,
	stephane.thiell@cea.fr
Subject: Re: [patch/rfc] Make poll/select report error (POLLNVAL and EBADF) for unsupported files
Date: Mon, 15 Feb 2010 18:42:39 +0100	[thread overview]
Message-ID: <1266255759.8262.26.camel@edumazet-laptop> (raw)
In-Reply-To: <alpine.DEB.2.00.1002141403240.18795@makko.or.mcafeemobile.com>

Le dimanche 14 février 2010 à 14:27 -0800, Davide Libenzi a écrit :
> Currently poll and select consider a non poll-supported file as one with 
> full event mask set, instead of reporting proper error to the caller.
> This behavior can fool the caller of proper functionality being returned, 
> while instead no valid event was processed/read from the device.
> This came out linked to this bug report:
> 
> http://bugzilla.kernel.org/show_bug.cgi?id=15272
> 
> IMHO, it'd be more adequate to report proper error code, for files that do 
> not support f_op->poll(), but then I am also not sure how much breakage 
> can this bring to existing (already broken "in just the right way") 
> applications.
> Untested, discussion-only, patch.
> 
> 
> Signed-off-by: Davide Libenzi <davidel@xmailserver.org>
> 
> 
> - Davide

Hmm, according to POSIX :

	The poll() function shall support regular files, terminal and
pseudo-terminal devices, FIFOs, pipes, sockets ...

	Regular files shall always poll TRUE for reading and writing.


So unless I missed something, this patch could break some conformant
applications.

In particular, if an application is polling() on stdin (usually a tty),
and other 'files', what's happening if we do :

cat replay_file | application

Either it wont read stdin, or application exits without reading its
input.




  reply	other threads:[~2010-02-15 17:42 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-02-14 22:27 Davide Libenzi
2010-02-15 17:42 ` Eric Dumazet [this message]
2010-02-15 17:47   ` Eric Dumazet
2010-02-15 17:50   ` Davide Libenzi
2010-02-17 17:21     ` THIELL Stephane
2010-02-17 18:16       ` Davide Libenzi

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=1266255759.8262.26.camel@edumazet-laptop \
    --to=eric.dumazet@gmail.com \
    --cc=akpm@linux-foundation.org \
    --cc=davidel@xmailserver.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=stephane.thiell@cea.fr \
    /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

all inboxes | Powered by JetHome®