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

[Minios-devel] [UNIKRAFT PATCH 4/5] lib/nolibc: add fs-related types



Signed-off-by: Yuri Volchkov <yuri.volchkov@xxxxxxxxx>
---
 lib/nolibc/include/limits.h                   |  3 +
 .../include/nolibc-internal/shareddefs.h      | 55 +++++++++++++++++++
 lib/nolibc/include/sys/types.h                |  6 ++
 3 files changed, 64 insertions(+)

diff --git a/lib/nolibc/include/limits.h b/lib/nolibc/include/limits.h
index faf87b35..2a621a5c 100644
--- a/lib/nolibc/include/limits.h
+++ b/lib/nolibc/include/limits.h
@@ -87,6 +87,9 @@ extern "C" {
 #define INTMAX_MAX   __LL_MAX
 #define UINTMAX_MAX __ULL_MAX
 
+#define PATH_MAX 4096
+#define NAME_MAX 255
+
 #ifdef __cplusplus
 }
 #endif
diff --git a/lib/nolibc/include/nolibc-internal/shareddefs.h 
b/lib/nolibc/include/nolibc-internal/shareddefs.h
index 9b81fab0..7572e2d3 100644
--- a/lib/nolibc/include/nolibc-internal/shareddefs.h
+++ b/lib/nolibc/include/nolibc-internal/shareddefs.h
@@ -90,3 +90,58 @@ struct timespec {
 };
 #define __DEFINED_struct_timespec
 #endif
+
+#if (defined __NEED_mode_t && !defined __DEFINED_mode_t)
+typedef unsigned mode_t;
+#define __DEFINED_mode_t
+#endif
+
+#if defined(__NEED_uid_t) && !defined(__DEFINED_uid_t)
+typedef unsigned uid_t;
+#define __DEFINED_uid_t
+#endif
+
+#if defined(__NEED_gid_t) && !defined(__DEFINED_gid_t)
+typedef unsigned gid_t;
+#define __DEFINED_gid_t
+#endif
+
+#if defined(__NEED_dev_t) && !defined(__DEFINED_dev_t)
+typedef __u64 dev_t;
+#define __DEFINED_dev_t
+#endif
+
+#if defined(__NEED_ino_t) && !defined(__DEFINED_ino_t)
+typedef __u64 ino_t;
+#define __DEFINED_ino_t
+#endif
+
+#if defined(__NEED_nlink_t) && !defined(__DEFINED_nlink_t)
+typedef __u32 nlink_t;
+#define __DEFINED_nlink_t
+#endif
+
+#if defined(__NEED_blkcnt_t) && !defined(__DEFINED_blkcnt_t)
+typedef __s64 blkcnt_t;
+#define __DEFINED_blkcnt_t
+#endif
+
+#if defined(__NEED_blksize_t) && !defined(__DEFINED_blksize_t)
+typedef long blksize_t;
+#define __DEFINED_blksize_t
+#endif
+
+#if defined(__NEED_struct_iovec) && !defined(__DEFINED_struct_iovec)
+struct iovec { void *iov_base; size_t iov_len; };
+#define __DEFINED_struct_iovec
+#endif
+
+#if defined(__NEED_fsblkcnt_t) && !defined(__DEFINED_fsblkcnt_t)
+typedef unsigned long long fsblkcnt_t;
+#define __DEFINED_fsblkcnt_t
+#endif
+
+#if defined(__NEED_fsfilcnt_t) && !defined(__DEFINED_fsfilcnt_t)
+typedef unsigned long long fsfilcnt_t;
+#define __DEFINED_fsfilcnt_t
+#endif
diff --git a/lib/nolibc/include/sys/types.h b/lib/nolibc/include/sys/types.h
index 942b533d..7c43ef3f 100644
--- a/lib/nolibc/include/sys/types.h
+++ b/lib/nolibc/include/sys/types.h
@@ -48,6 +48,12 @@ extern "C" {
 #define __NEED_off_t
 #define __NEED_time_t
 #define __NEED_suseconds_t
+#define __NEED_mode_t
+#define __NEED_uid_t
+#define __NEED_gid_t
+#define __NEED_dev_t
+#define __NEED_ino_t
+#define __NEED_nlink_t
 #include <nolibc-internal/shareddefs.h>
 
 #ifdef __cplusplus
-- 
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®.