]>
Commit | Line | Data |
---|---|---|
f7a9f785 | 1 | /* Copyright (C) 1991-2016 Free Software Foundation, Inc. |
6d52618b | 2 | This file is part of the GNU C Library. |
28f540f4 | 3 | |
6d52618b | 4 | The GNU C Library is free software; you can redistribute it and/or |
41bdb6e2 AJ |
5 | modify it under the terms of the GNU Lesser General Public |
6 | License as published by the Free Software Foundation; either | |
7 | version 2.1 of the License, or (at your option) any later version. | |
28f540f4 | 8 | |
6d52618b UD |
9 | The GNU C Library is distributed in the hope that it will be useful, |
10 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
41bdb6e2 | 12 | Lesser General Public License for more details. |
28f540f4 | 13 | |
41bdb6e2 | 14 | You should have received a copy of the GNU Lesser General Public |
59ba27a6 PE |
15 | License along with the GNU C Library; if not, see |
16 | <http://www.gnu.org/licenses/>. */ | |
28f540f4 | 17 | |
28f540f4 | 18 | #include <sys/types.h> |
0d3eb016 | 19 | #include <sys/time.h> |
28f540f4 RM |
20 | #include <hurd.h> |
21 | #include <hurd/fd.h> | |
28f540f4 RM |
22 | |
23 | /* Check the first NFDS descriptors each in READFDS (if not NULL) for read | |
24 | readiness, in WRITEFDS (if not NULL) for write readiness, and in EXCEPTFDS | |
25 | (if not NULL) for exceptional conditions. If TIMEOUT is not NULL, time out | |
26 | after waiting the interval specified therein. Returns the number of ready | |
27 | descriptors, or -1 for errors. */ | |
28 | int | |
f63f2bfd JM |
29 | __select (int nfds, fd_set *readfds, fd_set *writefds, fd_set *exceptfds, |
30 | struct timeval *timeout) | |
28f540f4 | 31 | { |
0d3eb016 | 32 | struct timespec ts, *to; |
28f540f4 | 33 | |
0d3eb016 | 34 | if (timeout) |
28f540f4 | 35 | { |
0d3eb016 RM |
36 | to = &ts; |
37 | TIMEVAL_TO_TIMESPEC (timeout, to); | |
28f540f4 | 38 | } |
ebe3b3eb | 39 | else |
0d3eb016 | 40 | to = NULL; |
28f540f4 | 41 | |
0d3eb016 | 42 | return _hurd_select (nfds, NULL, readfds, writefds, exceptfds, to, NULL); |
28f540f4 | 43 | } |
37ba7d66 | 44 | libc_hidden_def (__select) |
28f540f4 | 45 | weak_alias (__select, select) |