Re: RFC: poll change

Andrea Arcangeli (andrea@suse.de)
Wed, 15 Aug 2001 02:03:03 +0200


On Tue, Aug 14, 2001 at 03:42:33PM -0700, David S. Miller wrote:
> From: Herbert Xu <herbert@gondor.apana.org.au>
> Date: Wed, 15 Aug 2001 08:38:02 +1000
>
> Hmm, it still seems to be wrong:
> ...
>
> if (nfds > current->files->max_fds)
> nfds = current->files->max_fds;
>
> The second if statement should be removed. And it might be better to use
> current->rlim[RLIMIT_NOFILE].rlim_cur instead of NR_OPEN.
>
> It has to be limited to "max_fds", that is how many files we may
> legally address in current->files!

current->files only matters for the contents of the pollfd struct, not
for the number of pollfd structures passed on, removing such two lines
shouldn't destabilize anything, I think it's just a matter of API,
reading SuS it seems not to imply we have to truncate it to the max_fds
but OTOH the feedback I had was just happy with the 2.4 fix (so I didn't
even checked if the 2.4 fix was fully compliant or not..).

Andrea
-
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/