summaryrefslogtreecommitdiffstats
path: root/libc-top-half/musl/include/poll.h
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-17 13:54:38 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-17 13:54:38 +0000
commit8c1ab65c0f548d20b7f177bdb736daaf603340e1 (patch)
treedf55b7e75bf43f2bf500845b105afe3ac3a5157e /libc-top-half/musl/include/poll.h
parentInitial commit. (diff)
downloadwasi-libc-8c1ab65c0f548d20b7f177bdb736daaf603340e1.tar.xz
wasi-libc-8c1ab65c0f548d20b7f177bdb736daaf603340e1.zip
Adding upstream version 0.0~git20221206.8b7148f.upstream/0.0_git20221206.8b7148f
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'libc-top-half/musl/include/poll.h')
-rw-r--r--libc-top-half/musl/include/poll.h69
1 files changed, 69 insertions, 0 deletions
diff --git a/libc-top-half/musl/include/poll.h b/libc-top-half/musl/include/poll.h
new file mode 100644
index 0000000..cdbd29a
--- /dev/null
+++ b/libc-top-half/musl/include/poll.h
@@ -0,0 +1,69 @@
+#ifndef _POLL_H
+#define _POLL_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include <features.h>
+
+#include <bits/poll.h>
+
+#ifdef __wasilibc_unmodified_upstream /* Use alternate WASI libc headers */
+#define POLLIN 0x001
+#define POLLPRI 0x002
+#define POLLOUT 0x004
+#define POLLERR 0x008
+#define POLLHUP 0x010
+#define POLLNVAL 0x020
+#define POLLRDNORM 0x040
+#define POLLRDBAND 0x080
+#ifndef POLLWRNORM
+#define POLLWRNORM 0x100
+#define POLLWRBAND 0x200
+#endif
+#ifndef POLLMSG
+#define POLLMSG 0x400
+#define POLLRDHUP 0x2000
+#endif
+#else
+#include <__header_poll.h>
+#endif
+
+#ifdef __wasilibc_unmodified_upstream /* Use alternate WASI libc headers */
+typedef unsigned long nfds_t;
+#else
+#include <__typedef_nfds_t.h>
+#endif
+
+#ifdef __wasilibc_unmodified_upstream /* Use alternate WASI libc headers */
+struct pollfd {
+ int fd;
+ short events;
+ short revents;
+};
+#else
+#include <__struct_pollfd.h>
+#endif
+
+int poll (struct pollfd *, nfds_t, int);
+
+#ifdef _GNU_SOURCE
+#define __NEED_time_t
+#define __NEED_struct_timespec
+#define __NEED_sigset_t
+#include <bits/alltypes.h>
+int ppoll(struct pollfd *, nfds_t, const struct timespec *, const sigset_t *);
+#endif
+
+#if _REDIR_TIME64
+#ifdef _GNU_SOURCE
+__REDIR(ppoll, __ppoll_time64);
+#endif
+#endif
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif