1 /* vi: set sw=4 ts=4: */
5 * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
7 * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
10 #include <sys/syscall.h>
11 #include <sys/select.h>
13 extern __typeof(select) __libc_select;
15 #if !defined(__NR__newselect) && !defined(__NR_select) && defined __USE_XOPEN2K
16 # define __NR___libc_pselect6 __NR_pselect6
17 _syscall6(int, __libc_pselect6, int, n, fd_set *, readfds, fd_set *, writefds,
18 fd_set *, exceptfds, const struct timespec *, timeout,
19 const sigset_t *, sigmask)
21 int __libc_select(int n, fd_set *readfds, fd_set *writefds, fd_set *exceptfds,
22 struct timeval *timeout)
24 struct timespec _ts, *ts = 0;
26 _ts.tv_sec = timeout->tv_sec;
27 _ts.tv_nsec = timeout->tv_usec * 1000;
30 return __libc_pselect6(n, readfds, writefds, exceptfds, ts, 0);
35 #ifdef __NR__newselect
36 # define __NR___libc_select __NR__newselect
38 # define __NR___libc_select __NR_select
40 _syscall5(int, __libc_select, int, n, fd_set *, readfds, fd_set *, writefds,
41 fd_set *, exceptfds, struct timeval *, timeout)
45 /* libc_hidden_proto(select) */
46 weak_alias(__libc_select,select)
47 libc_hidden_weak(select)