]> xenbits.xensource.com Git - unikraft/libs/newlib.git/commitdiff
Provide our own <timespec.h> and <_timespec.h> headers
authorCostin Lupu <costin.lupu@cs.pub.ro>
Sun, 13 Oct 2019 13:37:31 +0000 (16:37 +0300)
committerFelipe Huici <felipe.huici@neclab.eu>
Wed, 16 Oct 2019 08:01:19 +0000 (10:01 +0200)
Newlib uses <timespec.h> and <_timespec.h> headers for defining itimerspec and
timespec types, respectively. However, these definitions are not protected with
preprocessing guards in case they were previously defined, which happens for us
because we define these types in uktime internal lib. Therefore the solution is
to skip using newlib's headers and provide our own.

Signed-off-by: Costin Lupu <costin.lupu@cs.pub.ro>
Reviewed-by: Felipe Huici <felipe.huici@neclab.eu>
include/sys/_timespec.h [new file with mode: 0644]
include/sys/timespec.h [new file with mode: 0644]
include/uk/_timespec.h [new file with mode: 0644]

diff --git a/include/sys/_timespec.h b/include/sys/_timespec.h
new file mode 100644 (file)
index 0000000..4be97c0
--- /dev/null
@@ -0,0 +1,6 @@
+#ifndef __NEWLIB_GLUE_SYS__TIMESPEC_H__
+#define __NEWLIB_GLUE_SYS__TIMESPEC_H__
+
+#include <uk/_timespec.h>
+
+#endif /* __NEWLIB_GLUE_SYS__TIMESPEC_H__ */
diff --git a/include/sys/timespec.h b/include/sys/timespec.h
new file mode 100644 (file)
index 0000000..bb42c17
--- /dev/null
@@ -0,0 +1,6 @@
+#ifndef __NEWLIB_GLUE_SYS_TIMESPEC_H__
+#define __NEWLIB_GLUE_SYS_TIMESPEC_H__
+
+#include <uk/_timespec.h>
+
+#endif /* __NEWLIB_GLUE_SYS_TIMESPEC_H__ */
diff --git a/include/uk/_timespec.h b/include/uk/_timespec.h
new file mode 100644 (file)
index 0000000..701ade6
--- /dev/null
@@ -0,0 +1,11 @@
+#ifndef __NEWLIB_GLUE_UK__TIMESPEC_H__
+#define __NEWLIB_GLUE_UK__TIMESPEC_H__
+
+#define __NEED_time_t
+#define __NEED_struct_timespec
+#include <uk/time_types.h>
+
+/* newlib guards */
+#define __time_t_defined
+
+#endif /* __NEWLIB_GLUE_UK__TIMESPEC_H__ */