mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: David Laight <David.Laight@ACULAB.COM>
To: 'richard clark' <richard.xnu.clark@gmail.com>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Cc: "torvalds@linux-foundation.org" <torvalds@linux-foundation.org>
Subject: RE: Question about select and poll system call
Date: Wed, 15 Mar 2023 08:59:34 +0000	[thread overview]
Message-ID: <c708bced26624078842ff7d83e8597d7@AcuMS.aculab.com> (raw)
In-Reply-To: <CAJNi4rNSHf3N6KrBNcVXKo-wjSPmZa2xan9WPmrER8Ttir-MDA@mail.gmail.com>

> 2. Can we unify the two different system calls? For example, using
> poll(...) to implement the frontend select call(...), is there
> something I'm missing for current implementation? The Cons and Pros,
> etc

The underlying code that implements them is common.

Beware that the glibc select() wrappers have their own limit
on the highest fd.
Exceeding that limit (probably 1024) will cause buffer overruns
in the application (One of the Android apps I uses crashes that way).

select() also doesn't scale well for sparse lists of fds.
So it really is best to use poll() and never select().
(Although for very large fd lists epoll() may be a better choice.)

	David

-
Registered Address Lakeside, Bramley Road, Mount Farm, Milton Keynes, MK1 1PT, UK
Registration No: 1397386 (Wales)

  parent reply	other threads:[~2023-03-15  9:00 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-14  2:28 richard clark
2023-03-14  2:31 ` richard clark
2023-03-15  3:31   ` richard clark
2023-03-15  8:59 ` David Laight [this message]
2023-03-16  0:56   ` richard clark
2023-03-16  9:34     ` David Laight
2023-03-16 18:15 ` Linus Torvalds
2023-03-17  8:26   ` richard clark
2023-03-18 12:40     ` David Laight

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=c708bced26624078842ff7d83e8597d7@AcuMS.aculab.com \
    --to=david.laight@aculab.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=richard.xnu.clark@gmail.com \
    --cc=torvalds@linux-foundation.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

all inboxes | Powered by JetHome®