Contents of /trunk/mkinitrd-magellan/klibc/usr/klibc/pselect.c
Parent Directory | Revision Log
Revision 532 -
(show annotations)
(download)
Sat Sep 1 22:45:15 2007 UTC (16 years, 8 months ago) by niro
File MIME type: text/plain
File size: 1085 byte(s)
Sat Sep 1 22:45:15 2007 UTC (16 years, 8 months ago) by niro
File MIME type: text/plain
File size: 1085 byte(s)
-import if magellan mkinitrd; it is a fork of redhats mkinitrd-5.0.8 with all magellan patches and features; deprecates magellan-src/mkinitrd
1 | /* |
2 | * pselect.c |
3 | */ |
4 | |
5 | #include <sys/select.h> |
6 | #include <sys/syscall.h> |
7 | |
8 | #if defined(__NR_pselect) && !_KLIBC_USE_RT_SIG |
9 | |
10 | /* Don't need to do anything here; use syscall stub directly */ |
11 | |
12 | #elif defined(__NR_pselect7) |
13 | |
14 | __extern int __pselect7(int, fd_set *, fd_set *, fd_set *, |
15 | const struct timespec *, const sigset_t *, size_t); |
16 | |
17 | int pselect(int n, fd_set * readfds, fd_set * writefds, fd_set * exceptfds, |
18 | const struct timespec *timeout, const sigset_t * sigmask) |
19 | { |
20 | return __pselect7(n, readfds, writefds, exceptfds, |
21 | timeout, sigmask, sizeof *sigmask); |
22 | } |
23 | |
24 | #elif defined(__NR_pselect6) |
25 | |
26 | struct __pselect6 { |
27 | const sigset_t *sigmask; |
28 | size_t sigsize; |
29 | }; |
30 | |
31 | __extern int __pselect6(int, fd_set *, fd_set *, fd_set *, |
32 | const struct timespec *, const struct __pselect6 *); |
33 | |
34 | int pselect(int n, fd_set * readfds, fd_set * writefds, fd_set * exceptfds, |
35 | const struct timespec *timeout, const sigset_t * sigmask) |
36 | { |
37 | struct __pselect6 extended_sigmask = { sigmask, sizeof *sigmask }; |
38 | return __pselect6(n, readfds, writefds, exceptfds, |
39 | timeout, &extended_sigmask); |
40 | } |
41 | |
42 | #endif |