mirror of
https://git.rtems.org/rtems-libbsd/
synced 2025-10-15 19:08:21 +08:00
Use poll() from FreeBSD
This commit is contained in:
@@ -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);
|
||||
|
@@ -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;
|
||||
}
|
Reference in New Issue
Block a user