Use poll() from FreeBSD

This commit is contained in:
Sebastian Huber
2013-10-28 09:54:33 +01:00
parent c33de69546
commit 08264c8b21
7 changed files with 135 additions and 35 deletions

View File

@@ -45,6 +45,7 @@
#define _RTEMS_BSD_MACHINE_RTEMS_BSD_SYSCALL_API_H_
#include <sys/cdefs.h>
#include <sys/poll.h>
#include <sys/select.h>
#include <sys/socket.h>
#include <sys/sysctl.h>
@@ -70,6 +71,8 @@ int getsockopt(int, int, int, void * __restrict, socklen_t * __restrict);
int listen(int, int);
int poll(struct pollfd _pfd[], nfds_t _nfds, int _timeout);
ssize_t recvfrom(int, void *, size_t, int, struct sockaddr * __restrict, socklen_t * __restrict);
ssize_t recvmsg(int, struct msghdr *, int);

View File

@@ -1,30 +0,0 @@
#include <unistd.h>
#include <errno.h>
#include <sys/time.h>
#include <rtems.h>
#include <rtems/error.h>
#include <sys/poll.h>
struct poll_args {
struct pollfd *fds;
u_int nfds;
int timeout;
};
int kern_poll( struct thread *td, struct poll_args *uap );
int
__sys_poll(struct pollfd *fds, unsigned nfds, int timeout)
{
struct poll_args uap;
struct thread *td = rtems_get_curthread();
uap.fds = fds;
uap.nfds = nfds;
uap.timeout = timeout;
kern_poll(td, &uap);
return -1;
}