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

[Minios-devel] [UNIKRAFT PATCH 2/5] lib/nolibc: adapt imported fs-related headers



Signed-off-by: Yuri Volchkov <yuri.volchkov@xxxxxxxxx>
---
 lib/nolibc/Makefile.uk           |  3 +++
 lib/nolibc/include/dirent.h      |  4 +---
 lib/nolibc/include/fcntl.h       | 11 ++++++-----
 lib/nolibc/include/sys/stat.h    | 25 +++++++++++++++++++++----
 lib/nolibc/include/sys/statvfs.h |  6 +-----
 lib/nolibc/include/sys/uio.h     |  9 +--------
 6 files changed, 33 insertions(+), 25 deletions(-)

diff --git a/lib/nolibc/Makefile.uk b/lib/nolibc/Makefile.uk
index bec5afe7..5e267fe2 100644
--- a/lib/nolibc/Makefile.uk
+++ b/lib/nolibc/Makefile.uk
@@ -20,6 +20,9 @@ CXXFLAGS-$(CONFIG_LIBNOLIBC)          += 
$(LIBNOLIBC_NO_BUILTINS)
 CINCLUDES-$(CONFIG_LIBNOLIBC)          += -I$(LIBNOLIBC_BASE)/include
 CXXINCLUDES-$(CONFIG_LIBNOLIBC)        += -I$(LIBNOLIBC_BASE)/include
 
+CINCLUDES-$(CONFIG_LIBNOLIBC)  += -I$(LIBNOLIBC_BASE)/arch/$(ARCH)
+CXXINCLUDES-$(CONFIG_LIBNOLIBC)        += -I$(LIBNOLIBC_BASE)/include
+
 LIBNOLIBC_SRCS-y += $(LIBNOLIBC_BASE)/errno.c
 LIBNOLIBC_SRCS-y += $(LIBNOLIBC_BASE)/stdio.c
 LIBNOLIBC_SRCS-y += $(LIBNOLIBC_BASE)/ctype.c
diff --git a/lib/nolibc/include/dirent.h b/lib/nolibc/include/dirent.h
index e0a8fe6a..9eeff8ae 100644
--- a/lib/nolibc/include/dirent.h
+++ b/lib/nolibc/include/dirent.h
@@ -5,15 +5,13 @@
 extern "C" {
 #endif
 
-#include <features.h>
-
 #define __NEED_ino_t
 #define __NEED_off_t
 #if defined(_BSD_SOURCE) || defined(_GNU_SOURCE)
 #define __NEED_size_t
 #endif
 
-#include <bits/alltypes.h>
+#include <nolibc-internal/shareddefs.h>
 
 typedef struct __dirstream DIR;
 
diff --git a/lib/nolibc/include/fcntl.h b/lib/nolibc/include/fcntl.h
index 6d8edcd1..4094c4f8 100644
--- a/lib/nolibc/include/fcntl.h
+++ b/lib/nolibc/include/fcntl.h
@@ -5,8 +5,6 @@
 extern "C" {
 #endif
 
-#include <features.h>
-
 #define __NEED_off_t
 #define __NEED_pid_t
 #define __NEED_mode_t
@@ -17,8 +15,7 @@ extern "C" {
 #define __NEED_struct_iovec
 #endif
 
-#include <bits/alltypes.h>
-
+#include <nolibc-internal/shareddefs.h>
 #include <bits/fcntl.h>
 
 struct flock {
@@ -26,7 +23,7 @@ struct flock {
        short l_whence;
        off_t l_start;
        off_t l_len;
-       pid_t l_pid;
+       /* pid_t l_pid; */
 };
 
 int creat(const char *, mode_t);
@@ -155,10 +152,14 @@ int lockf(int, int, off_t);
 #define F_OWNER_PID 1
 #define F_OWNER_PGRP 2
 #define F_OWNER_GID 2
+#if 0
+/* Not implemented */
 struct f_owner_ex {
        int type;
        pid_t pid;
 };
+#endif
+
 #define FALLOC_FL_KEEP_SIZE 1
 #define FALLOC_FL_PUNCH_HOLE 2
 #define SYNC_FILE_RANGE_WAIT_BEFORE 1
diff --git a/lib/nolibc/include/sys/stat.h b/lib/nolibc/include/sys/stat.h
index 9d096624..407bc20b 100644
--- a/lib/nolibc/include/sys/stat.h
+++ b/lib/nolibc/include/sys/stat.h
@@ -4,7 +4,7 @@
 extern "C" {
 #endif
 
-#include <features.h>
+/* #include <features.h> */
 
 #define __NEED_dev_t
 #define __NEED_ino_t
@@ -18,9 +18,26 @@ extern "C" {
 #define __NEED_blkcnt_t
 #define __NEED_struct_timespec
 
-#include <bits/alltypes.h>
-
-#include <bits/stat.h>
+#include <nolibc-internal/shareddefs.h>
+
+struct stat {
+       dev_t st_dev;
+       ino_t st_ino;
+       nlink_t st_nlink;
+
+       mode_t st_mode;
+       uid_t st_uid;
+       gid_t st_gid;
+       unsigned int    __pad0;
+       dev_t st_rdev;
+       off_t st_size;
+       blksize_t st_blksize;
+       blkcnt_t st_blocks;
+
+       struct timespec st_atim;
+       struct timespec st_mtim;
+       struct timespec st_ctim;
+};
 
 #define st_atime st_atim.tv_sec
 #define st_mtime st_mtim.tv_sec
diff --git a/lib/nolibc/include/sys/statvfs.h b/lib/nolibc/include/sys/statvfs.h
index ef07d684..85a2ff99 100644
--- a/lib/nolibc/include/sys/statvfs.h
+++ b/lib/nolibc/include/sys/statvfs.h
@@ -5,13 +5,9 @@
 extern "C" {
 #endif
 
-#include <features.h>
-
 #define __NEED_fsblkcnt_t
 #define __NEED_fsfilcnt_t
-#include <bits/alltypes.h>
-
-#include <endian.h>
+#include <nolibc-internal/shareddefs.h>
 
 struct statvfs {
        unsigned long f_bsize, f_frsize;
diff --git a/lib/nolibc/include/sys/uio.h b/lib/nolibc/include/sys/uio.h
index 00f73a2f..18266038 100644
--- a/lib/nolibc/include/sys/uio.h
+++ b/lib/nolibc/include/sys/uio.h
@@ -5,8 +5,6 @@
 extern "C" {
 #endif
 
-#include <features.h>
-
 #define __NEED_size_t
 #define __NEED_ssize_t
 #define __NEED_struct_iovec
@@ -19,7 +17,7 @@ extern "C" {
 #define __NEED_pid_t
 #endif
 
-#include <bits/alltypes.h>
+#include <nolibc-internal/shareddefs.h>
 
 #define UIO_MAXIOV 1024
 
@@ -36,11 +34,6 @@ ssize_t pwritev (int, const struct iovec *, int, off_t);
 #endif
 #endif
 
-#ifdef _GNU_SOURCE
-ssize_t process_vm_writev(pid_t, const struct iovec *, unsigned long, const 
struct iovec *, unsigned long, unsigned long);
-ssize_t process_vm_readv(pid_t, const struct iovec *, unsigned long, const 
struct iovec *, unsigned long, unsigned long);
-#endif
-
 #ifdef __cplusplus
 }
 #endif
-- 
2.19.2


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