[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAJNi4rMB46z2hejoPCHyy+qDwE5U2D7H1OUwZ3+_pFAT9-cN3A@mail.gmail.com>
Date: Thu, 16 Mar 2023 08:56:41 +0800
From: richard clark <richard.xnu.clark@...il.com>
To: David Laight <David.Laight@...lab.com>
Cc: "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
"torvalds@...ux-foundation.org" <torvalds@...ux-foundation.org>
Subject: Re: Question about select and poll system call
On Wed, Mar 15, 2023 at 4:59 PM David Laight <David.Laight@...lab.com> wrote:
>
> > 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).
Ah, interesting. Seems glibc doesn't make that limit from my testing
code snippet in last email...
>
> 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)
Powered by blists - more mailing lists