From 18723117271370e480f8ca9495f8850522fabb74 Mon Sep 17 00:00:00 2001 From: AKASHI Takahiro Date: Wed, 13 Nov 2019 09:44:50 +0900 Subject: lib: add mktime64() for linux compatibility This function will be used in lib/crypto/x509_cert_parser.c, which will also be imported from linux code in a later commit. Signed-off-by: AKASHI Takahiro --- include/linux/time.h | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'include/linux/time.h') diff --git a/include/linux/time.h b/include/linux/time.h index b8d298eb4d6..dc9344a6d97 100644 --- a/include/linux/time.h +++ b/include/linux/time.h @@ -1,6 +1,7 @@ #ifndef _LINUX_TIME_H #define _LINUX_TIME_H +#include #include #define _DEFUN(a,b,c) a(c) @@ -150,4 +151,13 @@ _DEFUN (ctime_r, (tim_p, result), return asctime_r (localtime_r (tim_p, &tm), result); } +/* for compatibility with linux code */ +typedef __s64 time64_t; + +#ifdef CONFIG_LIB_DATE +time64_t mktime64(const unsigned int year, const unsigned int mon, + const unsigned int day, const unsigned int hour, + const unsigned int min, const unsigned int sec); +#endif + #endif -- cgit v1.2.3 From bd3c3dd7fbb152412c16688cf3b70c6a302eda8a Mon Sep 17 00:00:00 2001 From: AKASHI Takahiro Date: Wed, 13 Nov 2019 09:44:52 +0900 Subject: linux/time.h: include vsprintf.h Without this commit, time.h possibly causes a build error as asctime_r() uses sprintf(). Signed-off-by: AKASHI Takahiro --- include/linux/time.h | 1 + 1 file changed, 1 insertion(+) (limited to 'include/linux/time.h') diff --git a/include/linux/time.h b/include/linux/time.h index dc9344a6d97..702dd276aea 100644 --- a/include/linux/time.h +++ b/include/linux/time.h @@ -2,6 +2,7 @@ #define _LINUX_TIME_H #include +#include #include #define _DEFUN(a,b,c) a(c) -- cgit v1.2.3