]>
git.ipfire.org Git - thirdparty/glibc.git/blob - sysdeps/unix/sysv/linux/microblaze/pselect32.c
1 /* Synchronous I/O multiplexing. Linux/microblaze version.
2 Copyright (C) 2019-2021 Free Software Foundation, Inc.
3 This file is part of the GNU C Library.
5 The GNU C Library is free software; you can redistribute it and/or
6 modify it under the terms of the GNU Lesser General Public
7 License as published by the Free Software Foundation; either
8 version 2.1 of the License, or (at your option) any later version.
10 The GNU C Library is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 Lesser General Public License for more details.
15 You should have received a copy of the GNU Lesser General Public
16 License along with the GNU C Library; if not, see
17 <https://www.gnu.org/licenses/>. */
23 #include <sysdep-cancel.h>
25 #ifndef __ASSUME_PSELECT
27 __pselect32 (int nfds
, fd_set
*readfds
, fd_set
*writefds
,
28 fd_set
*exceptfds
, const struct __timespec64
*timeout
,
29 const sigset_t
*sigmask
)
31 /* The fallback uses 'select' which shows the race condition regarding
32 signal mask set/restore, requires two additional syscalls, and has
33 a worse timeout precision (microseconds instead of nanoseconds). */
35 struct timeval tv32
, *ptv32
= NULL
;
38 if (! in_time_t_range (timeout
->tv_sec
)
39 || ! valid_nanoseconds (timeout
->tv_nsec
))
45 tv32
= valid_timespec64_to_timeval (*timeout
);
51 __sigprocmask (SIG_SETMASK
, sigmask
, &savemask
);
53 /* select itself is a cancellation entrypoint. */
54 int ret
= __select (nfds
, readfds
, writefds
, exceptfds
, ptv32
);
57 __sigprocmask (SIG_SETMASK
, &savemask
, NULL
);
61 #endif /* __ASSUME_PSELECT */