The eventfd.h only differs by presense of declaration
eventfd2() function which is not a Linux ABI function but syscall name
and was probably added to the header to accomodate implementing
eventfd2 as a syscall in linux.cc. So let us move that declaration
to linux.cc where it is used.

Signed-off-by: Waldemar Kozaczuk <[email protected]>
---
 include/api/sys/eventfd.h   | 28 +---------------------------
 linux.cc                    |  2 ++
 3 files changed, 4 insertions(+), 27 deletions(-)
 mode change 100644 => 120000 include/api/sys/eventfd.h

diff --git a/include/api/sys/eventfd.h b/include/api/sys/eventfd.h
deleted file mode 100644
index 1bcf0ecd..00000000
--- a/include/api/sys/eventfd.h
+++ /dev/null
@@ -1,27 +0,0 @@
-#ifndef _SYS_EVENTFD_H
-#define _SYS_EVENTFD_H
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#include <stdint.h>
-#include <fcntl.h>
-
-typedef uint64_t eventfd_t;
-
-#define EFD_SEMAPHORE 1
-#define EFD_CLOEXEC O_CLOEXEC
-#define EFD_NONBLOCK O_NONBLOCK
-
-int eventfd(unsigned int, int);
-int eventfd2(unsigned int, int);
-int eventfd_read(int, eventfd_t *);
-int eventfd_write(int, eventfd_t);
-
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* sys/eventfd.h */
diff --git a/include/api/sys/eventfd.h b/include/api/sys/eventfd.h
new file mode 120000
index 00000000..323fa1cd
--- /dev/null
+++ b/include/api/sys/eventfd.h
@@ -0,0 +1 @@
+../../../musl/include/sys/eventfd.h
\ No newline at end of file
diff --git a/linux.cc b/linux.cc
index 9487af35..c2189799 100644
--- a/linux.cc
+++ b/linux.cc
@@ -42,6 +42,8 @@
 
 #include <musl/src/internal/ksigaction.h>
 
+extern "C" int eventfd2(unsigned int, int);
+
 extern "C" long gettid()
 {
     return sched::thread::current()->id();
-- 
2.26.2

-- 
You received this message because you are subscribed to the Google Groups "OSv 
Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/osv-dev/20200829043601.573865-1-jwkozaczuk%40gmail.com.

Reply via email to