* lib/select.c (rpl_select): Fail if nfds is out-of-range.
* lib/pselect.c (pselect): Likewise.
+2023-04-24 Bruno Haible <bruno@clisp.org>
+
+ select, pselect: Fix test failure on native Windows.
+ * lib/select.c (rpl_select): Fail if nfds is out-of-range.
+ * lib/pselect.c (pselect): Likewise.
+
2023-04-24 Bruno Haible <bruno@clisp.org>
ftell, ftello: Fix recognition of pipes on native Windows.
/* pselect - synchronous I/O multiplexing
- Copyright 2011-2022 Free Software Foundation, Inc.
+ Copyright 2011-2023 Free Software Foundation, Inc.
This file is part of gnulib.
sigset_t origmask;
struct timeval tv, *tvp;
+ if (nfds < 0 || nfds > FD_SETSIZE)
+ {
+ errno = EINVAL;
+ return -1;
+ }
+
if (timeout)
{
if (! (0 <= timeout->tv_nsec && timeout->tv_nsec < 1000000000))
/* Emulation for select(2)
Contributed by Paolo Bonzini.
- Copyright 2008-2022 Free Software Foundation, Inc.
+ Copyright 2008-2023 Free Software Foundation, Inc.
This file is part of gnulib.
int i, fd, rc;
clock_t tend;
- if (nfds > FD_SETSIZE)
- nfds = FD_SETSIZE;
+ if (nfds < 0 || nfds > FD_SETSIZE)
+ {
+ errno = EINVAL;
+ return -1;
+ }
if (!timeout)
wait_timeout = INFINITE;