diff --git a/src/kernel/libroot/posix/poll.c b/src/kernel/libroot/posix/poll.c new file mode 100644 index 0000000000..462ff2f5f7 --- /dev/null +++ b/src/kernel/libroot/posix/poll.c @@ -0,0 +1,16 @@ +/* +** Copyright 2002, Axel Dörfler, axeld@pinc-software.de. All rights reserved. +** Distributed under the terms of the OpenBeOS License. +*/ + + +#include +#include + + +int +poll(struct pollfd *fds, nfds_t numfds, int timeout) +{ + return sys_poll(fds, numfds, timeout * 1000LL); +} + diff --git a/src/kernel/libroot/posix/sys/select.c b/src/kernel/libroot/posix/sys/select.c new file mode 100644 index 0000000000..c584a7cfb4 --- /dev/null +++ b/src/kernel/libroot/posix/sys/select.c @@ -0,0 +1,33 @@ +/* +** Copyright 2002, Axel Dörfler, axeld@pinc-software.de. All rights reserved. +** Distributed under the terms of the OpenBeOS License. +*/ + + +#include +#include + + +int +pselect(int numBits, struct fd_set *readBits, struct fd_set *writeBits, + struct fd_set *errorBits, const struct timespec *tv, const sigset_t *sigMask) +{ + bigtime_t timeout = -1LL; + if (tv) + timeout = tv->tv_sec * 1000000LL + tv->tv_nsec / 1000LL; + + return sys_select(numBits, readBits, writeBits, errorBits, timeout, sigMask); +} + + +int +select(int numBits, struct fd_set *readBits, struct fd_set *writeBits, + struct fd_set *errorBits, struct timeval *tv) +{ + bigtime_t timeout = -1LL; + if (tv) + timeout = tv->tv_sec * 1000000LL + tv->tv_usec; + + return sys_select(numBits, readBits, writeBits, errorBits, timeout, NULL); +} +