Messages in this thread | | | Date | Sun, 14 Mar 2004 12:58:42 -0300 (BRT) | From | Marcelo Tosatti <> | Subject | Re: [PATCH 2.4] sys_select() return error on bad file |
| |
On Thu, 4 Mar 2004, Armin Schindler wrote:
> On Thu, 4 Mar 2004, Willy Tarreau wrote: > > Hi, > > > > On Wed, Mar 03, 2004 at 09:46:54AM +0100, Armin Schindler wrote: > > > --- linux/fs/select.c_orig 2004-03-02 19:06:44.000000000 +0100 > > > +++ linux/fs/select.c 2004-03-03 09:25:24.000000000 +0100 > > > @@ -183,6 +183,8 @@ > > > wait = NULL; > > > retval = 0; > > > for (;;) { > > > + int file_err = 1; > > > + > > > > Just a thought, select() is often performance-critical, and adding one more > > variable inside the loop can slow it down a bit. Wouldn't it be cheaper to > > set retval to -EBADF above and avoid using file_err ? > > retval cannot be used for that, it may get changed in the loop. > > Anyway, I don't see how your proposal would do better performance? > My patch just adds a new variable on the stack, which should not make any > difference in performance. And later, it is the same if the new or another > variable gets changed or checked.
Curiosity: Does SuS/POSIX define behaviour for "all fds are closed" ?
- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
| |