mirror of
https://github.com/matter-labs/nixsgx.git
synced 2025-07-21 23:43:56 +02:00
feat: initial commit
Signed-off-by: Harald Hoyer <harald@matterlabs.dev>
This commit is contained in:
parent
6fe41c9723
commit
1054e3dbe4
51 changed files with 3521 additions and 1 deletions
36
packages/libuv/no-eventfd.patch
Normal file
36
packages/libuv/no-eventfd.patch
Normal file
|
@ -0,0 +1,36 @@
|
|||
diff --git a/src/unix/async.c b/src/unix/async.c
|
||||
index 0ff2669e..2bb87863 100644
|
||||
--- a/src/unix/async.c
|
||||
+++ b/src/unix/async.c
|
||||
@@ -35,6 +35,13 @@
|
||||
#include <sched.h> /* sched_yield() */
|
||||
|
||||
#ifdef __linux__
|
||||
+#define HAVE_EVENT_FD
|
||||
+#endif
|
||||
+
|
||||
+// No eventfd for gramine
|
||||
+#undef HAVE_EVENT_FD
|
||||
+
|
||||
+#ifdef HAVE_EVENT_FD
|
||||
#include <sys/eventfd.h>
|
||||
#endif
|
||||
|
||||
@@ -188,7 +195,7 @@ static void uv__async_send(uv_loop_t* loop) {
|
||||
len = 1;
|
||||
fd = loop->async_wfd;
|
||||
|
||||
-#if defined(__linux__)
|
||||
+#if defined(HAVE_EVENT_FD)
|
||||
if (fd == -1) {
|
||||
static const uint64_t val = 1;
|
||||
buf = &val;
|
||||
@@ -219,7 +226,7 @@ static int uv__async_start(uv_loop_t* loop) {
|
||||
if (loop->async_io_watcher.fd != -1)
|
||||
return 0;
|
||||
|
||||
-#ifdef __linux__
|
||||
+#ifdef HAVE_EVENT_FD
|
||||
err = eventfd(0, EFD_CLOEXEC | EFD_NONBLOCK);
|
||||
if (err < 0)
|
||||
return UV__ERR(errno);
|
Loading…
Add table
Add a link
Reference in a new issue