From: Waldemar Kozaczuk <[email protected]>
Committer: Nadav Har'El <[email protected]>
Branch: master

libc: replace include/api/sys/eventfd.h with symlink to musl copy

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]>
Message-Id: <[email protected]>

---
diff --git a/include/api/sys/eventfd.h b/include/api/sys/eventfd.h
--- a/include/api/sys/eventfd.h
+++ b/include/api/sys/eventfd.h
@@ -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
--- a/include/api/sys/eventfd.h
+++ 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
--- 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();

-- 
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/000000000000caf25205ae19a2f8%40google.com.

Reply via email to