From: Costin Lupu Date: Sun, 13 Oct 2019 13:37:31 +0000 (+0300) Subject: Provide our own and <_timespec.h> headers X-Git-Tag: RELEASE-0.4~27 X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=c19a811f99ac4c6accba399a9ae364852f415baf;p=unikraft%2Flibs%2Fnewlib.git Provide our own and <_timespec.h> headers Newlib uses 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 Reviewed-by: Felipe Huici --- diff --git a/include/sys/_timespec.h b/include/sys/_timespec.h new file mode 100644 index 0000000..4be97c0 --- /dev/null +++ b/include/sys/_timespec.h @@ -0,0 +1,6 @@ +#ifndef __NEWLIB_GLUE_SYS__TIMESPEC_H__ +#define __NEWLIB_GLUE_SYS__TIMESPEC_H__ + +#include + +#endif /* __NEWLIB_GLUE_SYS__TIMESPEC_H__ */ diff --git a/include/sys/timespec.h b/include/sys/timespec.h new file mode 100644 index 0000000..bb42c17 --- /dev/null +++ b/include/sys/timespec.h @@ -0,0 +1,6 @@ +#ifndef __NEWLIB_GLUE_SYS_TIMESPEC_H__ +#define __NEWLIB_GLUE_SYS_TIMESPEC_H__ + +#include + +#endif /* __NEWLIB_GLUE_SYS_TIMESPEC_H__ */ diff --git a/include/uk/_timespec.h b/include/uk/_timespec.h new file mode 100644 index 0000000..701ade6 --- /dev/null +++ b/include/uk/_timespec.h @@ -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 + +/* newlib guards */ +#define __time_t_defined + +#endif /* __NEWLIB_GLUE_UK__TIMESPEC_H__ */