2 * Copyright 2002-2007, Axel Dörfler, axeld@pinc-software.de.
4 * Distributed under the terms of the MIT License.
8 #include <sys/select.h>
13 #include <syscall_utils.h>
15 #include <errno_private.h>
16 #include <symbol_versioning.h>
19 #include <signal_private.h>
22 int __pselect_beos(int numBits
, struct fd_set
*readBits
,
23 struct fd_set
*writeBits
, struct fd_set
*errorBits
,
24 const struct timespec
*tv
, const sigset_t
*beosSignalMask
);
25 int __pselect(int numBits
, struct fd_set
*readBits
, struct fd_set
*writeBits
,
26 struct fd_set
*errorBits
, const struct timespec
*tv
,
27 const sigset_t
*sigMask
);
31 __pselect_beos(int numBits
, struct fd_set
*readBits
, struct fd_set
*writeBits
,
32 struct fd_set
*errorBits
, const struct timespec
*tv
,
33 const sigset_t
*beosSignalMask
)
37 bigtime_t timeout
= -1LL;
39 timeout
= tv
->tv_sec
* 1000000LL + tv
->tv_nsec
/ 1000LL;
41 if (beosSignalMask
!= NULL
)
42 signalMask
= from_beos_sigset(*beosSignalMask
);
44 status
= _kern_select(numBits
, readBits
, writeBits
, errorBits
, timeout
,
45 beosSignalMask
!= NULL
? &signalMask
: NULL
);
47 RETURN_AND_SET_ERRNO_TEST_CANCEL(status
);
52 __pselect(int numBits
, struct fd_set
*readBits
, struct fd_set
*writeBits
,
53 struct fd_set
*errorBits
, const struct timespec
*tv
,
54 const sigset_t
*sigMask
)
57 bigtime_t timeout
= -1LL;
59 timeout
= tv
->tv_sec
* 1000000LL + tv
->tv_nsec
/ 1000LL;
61 status
= _kern_select(numBits
, readBits
, writeBits
, errorBits
, timeout
,
64 RETURN_AND_SET_ERRNO_TEST_CANCEL(status
);
69 select(int numBits
, struct fd_set
*readBits
, struct fd_set
*writeBits
,
70 struct fd_set
*errorBits
, struct timeval
*tv
)
73 bigtime_t timeout
= -1LL;
75 timeout
= tv
->tv_sec
* 1000000LL + tv
->tv_usec
;
77 status
= _kern_select(numBits
, readBits
, writeBits
, errorBits
, timeout
,
80 RETURN_AND_SET_ERRNO_TEST_CANCEL(status
);
84 DEFINE_LIBROOT_KERNEL_SYMBOL_VERSION("__pselect_beos", "pselect@", "BASE");
86 DEFINE_LIBROOT_KERNEL_SYMBOL_VERSION("__pselect", "pselect@@", "1_ALPHA4");