[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Minios-devel] [UNIKRAFT/LIBNEWLIB PATCH] Add sys/epoll.h



Looks fine to me... another proof that newlib seems to be incomplete for most applications that we port. :-)

Thanks,

Simon

Reviewed-by: Simon Kuenzer <simon.kuenzer@xxxxxxxxx>

On 13.02.20 21:40, Felipe Huici wrote:
Add header file sys/epoll.h from musl, needed by libgo and likely
other libs.

Signed-off-by: Felipe Huici <felipe.huici@xxxxxxxxx>
---
  musl-imported/include/sys/epoll.h | 65 +++++++++++++++++++++++++++++++
  1 file changed, 65 insertions(+)
  create mode 100644 musl-imported/include/sys/epoll.h

diff --git a/musl-imported/include/sys/epoll.h 
b/musl-imported/include/sys/epoll.h
new file mode 100644
index 0000000..c507a29
--- /dev/null
+++ b/musl-imported/include/sys/epoll.h
@@ -0,0 +1,65 @@
+#ifndef        _SYS_EPOLL_H
+#define        _SYS_EPOLL_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include <stdint.h>
+#include <sys/types.h>
+
+#define __NEED_sigset_t
+
+#define EPOLL_CLOEXEC O_CLOEXEC
+#define EPOLL_NONBLOCK O_NONBLOCK
+
+enum EPOLL_EVENTS { __EPOLL_DUMMY };
+#define EPOLLIN 0x001
+#define EPOLLPRI 0x002
+#define EPOLLOUT 0x004
+#define EPOLLRDNORM 0x040
+#define EPOLLRDBAND 0x080
+#define EPOLLWRNORM 0x100
+#define EPOLLWRBAND 0x200
+#define EPOLLMSG 0x400
+#define EPOLLERR 0x008
+#define EPOLLHUP 0x010
+#define EPOLLRDHUP 0x2000
+#define EPOLLEXCLUSIVE (1U<<28)
+#define EPOLLWAKEUP (1U<<29)
+#define EPOLLONESHOT (1U<<30)
+#define EPOLLET (1U<<31)
+
+#define EPOLL_CTL_ADD 1
+#define EPOLL_CTL_DEL 2
+#define EPOLL_CTL_MOD 3
+
+typedef union epoll_data {
+       void *ptr;
+       int fd;
+       uint32_t u32;
+       uint64_t u64;
+} epoll_data_t;
+
+struct epoll_event {
+       uint32_t events;
+       epoll_data_t data;
+}
+#ifdef __x86_64__
+__attribute__ ((__packed__))
+#endif
+;
+
+
+int epoll_create(int);
+int epoll_create1(int);
+int epoll_ctl(int, int, int, struct epoll_event *);
+int epoll_wait(int, struct epoll_event *, int, int);
+int epoll_pwait(int, struct epoll_event *, int, int, const sigset_t *);
+
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* sys/epoll.h */


_______________________________________________
Minios-devel mailing list
Minios-devel@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/mailman/listinfo/minios-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.