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

[Minios-devel] [UNIKRAFT PATCH 3/3] lib/posix-process: Adapt sys/resource.h



We use Unikraft types and define the missing id_t type for nolibc.

Signed-off-by: Costin Lupu <costin.lupu@xxxxxxxxx>
---
 lib/nolibc/include/nolibc-internal/shareddefs.h        | 5 +++++
 lib/nolibc/include/sys/types.h                         | 1 +
 lib/posix-process/Config.uk                            | 1 +
 lib/posix-process/Makefile.uk                          | 7 +++++--
 lib/posix-process/musl-imported/include/sys/resource.h | 3 +--
 5 files changed, 13 insertions(+), 4 deletions(-)

diff --git a/lib/nolibc/include/nolibc-internal/shareddefs.h 
b/lib/nolibc/include/nolibc-internal/shareddefs.h
index 8c8e68a8..d386820e 100644
--- a/lib/nolibc/include/nolibc-internal/shareddefs.h
+++ b/lib/nolibc/include/nolibc-internal/shareddefs.h
@@ -95,6 +95,11 @@ typedef int pid_t;
 #define __DEFINED_pid_t
 #endif
 
+#if defined(__NEED_id_t) && !defined(__DEFINED_id_t)
+typedef unsigned id_t;
+#define __DEFINED_id_t
+#endif
+
 #if defined(__NEED_dev_t) && !defined(__DEFINED_dev_t)
 typedef __u64 dev_t;
 #define __DEFINED_dev_t
diff --git a/lib/nolibc/include/sys/types.h b/lib/nolibc/include/sys/types.h
index 412d1ff0..4da777c8 100644
--- a/lib/nolibc/include/sys/types.h
+++ b/lib/nolibc/include/sys/types.h
@@ -56,6 +56,7 @@ extern "C" {
 #define __NEED_uid_t
 #define __NEED_gid_t
 #define __NEED_pid_t
+#define __NEED_id_t
 #define __NEED_dev_t
 #define __NEED_ino_t
 #define __NEED_nlink_t
diff --git a/lib/posix-process/Config.uk b/lib/posix-process/Config.uk
index 62fea8b5..f00f8b3e 100644
--- a/lib/posix-process/Config.uk
+++ b/lib/posix-process/Config.uk
@@ -2,3 +2,4 @@ config POSIX_PROCESS
        bool "POSIX process-related functions"
        default n
        select LIBNOLIBC if !HAVE_LIBC
+       select LIBUKTIME
diff --git a/lib/posix-process/Makefile.uk b/lib/posix-process/Makefile.uk
index bd280bba..e6fcb675 100644
--- a/lib/posix-process/Makefile.uk
+++ b/lib/posix-process/Makefile.uk
@@ -1,7 +1,10 @@
 $(eval $(call addlib_s,posix_process,$(CONFIG_POSIX_PROCESS)))
 
-CINCLUDES-$(CONFIG_POSIX_PROCESS)     += -I$(POSIX_PROCESS_BASE)/include
-CXXINCLUDES-$(CONFIG_POSIX_PROCESS)   += -I$(POSIX_PROCESS_BASE)/include
+POSIX_PROCESS_COMMON_INCLUDES-y       += -I$(POSIX_PROCESS_BASE)/include
+POSIX_PROCESS_COMMON_INCLUDES-y       += 
-I$(POSIX_PROCESS_BASE)/musl-imported/include
+POSIX_PROCESS_COMMON_INCLUDES-y       += 
-I$(POSIX_PROCESS_BASE)/musl-imported/arch/generic
+CINCLUDES-$(CONFIG_POSIX_PROCESS)     += $(POSIX_PROCESS_COMMON_INCLUDES-y)
+CXXINCLUDES-$(CONFIG_POSIX_PROCESS)   += $(POSIX_PROCESS_COMMON_INCLUDES-y)
 
 POSIX_PROCESS_SUPPRESS_FLAGS-y   += -Wno-unused-parameter
 POSIX_PROCESS_CFLAGS-y           += $(POSIX_PROCESS_SUPPRESS_FLAGS-y)
diff --git a/lib/posix-process/musl-imported/include/sys/resource.h 
b/lib/posix-process/musl-imported/include/sys/resource.h
index 70d793d5..b513c1e2 100644
--- a/lib/posix-process/musl-imported/include/sys/resource.h
+++ b/lib/posix-process/musl-imported/include/sys/resource.h
@@ -5,7 +5,6 @@
 extern "C" {
 #endif
 
-#include <features.h>
 #include <sys/time.h>
 
 #define __NEED_id_t
@@ -14,7 +13,7 @@ extern "C" {
 #define __NEED_pid_t
 #endif
 
-#include <bits/alltypes.h>
+#include <sys/types.h>
 #include <bits/resource.h>
 
 typedef unsigned long long rlim_t;
-- 
2.20.1


_______________________________________________
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®.