diff options
author | Nguyễn Thái Ngọc Duy <pclouds@gmail.com> | 2010-04-14 06:56:24 +0200 |
---|---|---|
committer | Nguyễn Thái Ngọc Duy <pclouds@gmail.com> | 2010-09-10 18:39:53 +1000 |
commit | 487a13c7c8e23268145c3dd88317cd8ea547c901 (patch) | |
tree | 2829d4e0b631e410adbe15a2b7ed4f9209df44c6 | |
parent | eefbe3a047b640b861f3e78cb036cd70b9c5790e (diff) | |
download | busybox-w32-487a13c7c8e23268145c3dd88317cd8ea547c901.tar.gz busybox-w32-487a13c7c8e23268145c3dd88317cd8ea547c901.tar.bz2 busybox-w32-487a13c7c8e23268145c3dd88317cd8ea547c901.zip |
win32: add gmtime_r()
-rw-r--r-- | include/mingw.h | 2 | ||||
-rw-r--r-- | win32/mingw.c | 7 |
2 files changed, 8 insertions, 1 deletions
diff --git a/include/mingw.h b/include/mingw.h index 45bd32df1..a646af334 100644 --- a/include/mingw.h +++ b/include/mingw.h | |||
@@ -221,7 +221,7 @@ NOIMPL(waitpid,pid_t pid UNUSED_PARAM, int *status UNUSED_PARAM, unsigned option | |||
221 | /* | 221 | /* |
222 | * time.h | 222 | * time.h |
223 | */ | 223 | */ |
224 | IMPL(gmtime_r,struct tm *,NULL,const time_t *timep UNUSED_PARAM, struct tm *result UNUSED_PARAM); | 224 | struct tm *gmtime_r(const time_t *timep, struct tm *result); |
225 | IMPL(localtime_r,struct tm *,NULL,const time_t *timep UNUSED_PARAM, struct tm *result UNUSED_PARAM); | 225 | IMPL(localtime_r,struct tm *,NULL,const time_t *timep UNUSED_PARAM, struct tm *result UNUSED_PARAM); |
226 | IMPL(strptime,char*,NULL,const char *s UNUSED_PARAM, const char *format UNUSED_PARAM, struct tm *tm UNUSED_PARAM); | 226 | IMPL(strptime,char*,NULL,const char *s UNUSED_PARAM, const char *format UNUSED_PARAM, struct tm *tm UNUSED_PARAM); |
227 | 227 | ||
diff --git a/win32/mingw.c b/win32/mingw.c index 09d746f21..1a476651a 100644 --- a/win32/mingw.c +++ b/win32/mingw.c | |||
@@ -62,3 +62,10 @@ int pipe(int filedes[2]) | |||
62 | return -1; | 62 | return -1; |
63 | return 0; | 63 | return 0; |
64 | } | 64 | } |
65 | |||
66 | struct tm *gmtime_r(const time_t *timep, struct tm *result) | ||
67 | { | ||
68 | /* gmtime() in MSVCRT.DLL is thread-safe, but not reentrant */ | ||
69 | memcpy(result, gmtime(timep), sizeof(struct tm)); | ||
70 | return result; | ||
71 | } | ||