Browse Source

Merge pull request #1224 from armink/fix_minilibc_time

Fix minilibc time
Bernard Xiong 7 years ago
parent
commit
40b580b223

+ 2 - 0
components/libc/compilers/minilibc/sys/types.h

@@ -15,6 +15,8 @@ typedef int mode_t;
 typedef unsigned long clockid_t;
 typedef unsigned long clockid_t;
 typedef int pid_t;
 typedef int pid_t;
 
 
+typedef	unsigned long clock_t; /* clock() */
+
 #ifndef NULL
 #ifndef NULL
 #define NULL        (0)
 #define NULL        (0)
 #endif
 #endif

+ 10 - 0
components/libc/compilers/minilibc/time.h

@@ -3,4 +3,14 @@
 
 
 #include <sys/time.h>
 #include <sys/time.h>
 
 
+time_t mktime(struct tm * const t);
+
+char *asctime(const struct tm *timeptr);
+char *ctime(const time_t *timep);
+struct tm* localtime(const time_t* t);
+
+char *asctime_r(const struct tm *t, char *buf);
+struct tm *gmtime_r(const time_t *timep, struct tm *r);
+struct tm* localtime_r(const time_t* t, struct tm* r);
+
 #endif
 #endif