aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNguyễn Thái Ngọc Duy <pclouds@gmail.com>2010-04-14 06:56:24 +0200
committerNguyễn Thái Ngọc Duy <pclouds@gmail.com>2010-04-20 19:14:02 +0200
commitdf414e9d639a8c1253cfb6225609e22eed91150a (patch)
tree704fcd569be8a7e974a57aa198036b6da8e083f0
parent5963dfebf78dfb59bcb3914bd34ba78113537c4a (diff)
downloadbusybox-w32-df414e9d639a8c1253cfb6225609e22eed91150a.tar.gz
busybox-w32-df414e9d639a8c1253cfb6225609e22eed91150a.tar.bz2
busybox-w32-df414e9d639a8c1253cfb6225609e22eed91150a.zip
win32: add gmtime_r()
Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
-rw-r--r--include/mingw.h2
-rw-r--r--win32/mingw.c7
2 files changed, 8 insertions, 1 deletions
diff --git a/include/mingw.h b/include/mingw.h
index b946d3d81..27d1135d3 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 */
224IMPL(gmtime_r,struct tm *,NULL,const time_t *timep UNUSED_PARAM, struct tm *result UNUSED_PARAM); 224struct tm *gmtime_r(const time_t *timep, struct tm *result);
225IMPL(localtime_r,struct tm *,NULL,const time_t *timep UNUSED_PARAM, struct tm *result UNUSED_PARAM); 225IMPL(localtime_r,struct tm *,NULL,const time_t *timep UNUSED_PARAM, struct tm *result UNUSED_PARAM);
226IMPL(strptime,char*,NULL,const char *s UNUSED_PARAM, const char *format UNUSED_PARAM, struct tm *tm UNUSED_PARAM); 226IMPL(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
66struct 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}