summaryrefslogtreecommitdiff
path: root/src/utils/os_win32.c
diff options
context:
space:
mode:
authorRui Paulo <rpaulo@FreeBSD.org>2013-06-25 02:47:41 +0000
committerRui Paulo <rpaulo@FreeBSD.org>2013-06-25 02:47:41 +0000
commit5e2639d568f6bb660501a77cc83413c3412562e3 (patch)
treedb97ebf07cc76b41926fb6696433b541307fbc19 /src/utils/os_win32.c
parent19f9885f6aafcd7c3eee4df8a014287d12279851 (diff)
Notes
Diffstat (limited to 'src/utils/os_win32.c')
-rw-r--r--src/utils/os_win32.c29
1 files changed, 21 insertions, 8 deletions
diff --git a/src/utils/os_win32.c b/src/utils/os_win32.c
index 074096480a405..163cebefce265 100644
--- a/src/utils/os_win32.c
+++ b/src/utils/os_win32.c
@@ -2,17 +2,12 @@
* wpa_supplicant/hostapd / OS specific functions for Win32 systems
* Copyright (c) 2005-2006, Jouni Malinen <j@w1.fi>
*
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 as
- * published by the Free Software Foundation.
- *
- * Alternatively, this software may be distributed under the terms of BSD
- * license.
- *
- * See README and COPYING for more details.
+ * This software may be distributed under the terms of the BSD license.
+ * See README for more details.
*/
#include "includes.h"
+#include <time.h>
#include <winsock2.h>
#include <wincrypt.h>
@@ -92,6 +87,24 @@ int os_mktime(int year, int month, int day, int hour, int min, int sec,
}
+int os_gmtime(os_time_t t, struct os_tm *tm)
+{
+ struct tm *tm2;
+ time_t t2 = t;
+
+ tm2 = gmtime(&t2);
+ if (tm2 == NULL)
+ return -1;
+ tm->sec = tm2->tm_sec;
+ tm->min = tm2->tm_min;
+ tm->hour = tm2->tm_hour;
+ tm->day = tm2->tm_mday;
+ tm->month = tm2->tm_mon + 1;
+ tm->year = tm2->tm_year + 1900;
+ return 0;
+}
+
+
int os_daemonize(const char *pid_file)
{
/* TODO */