more cleanup

This commit is contained in:
Nguyen Anh Quynh
2017-01-10 16:29:47 +08:00
parent c1f39c3db2
commit 7512ff57de
18 changed files with 1 additions and 778 deletions

View File

@ -62,7 +62,7 @@ void *qemu_memalign(size_t alignment, size_t size)
{
return qemu_oom_check(qemu_try_memalign(alignment, size));
}
void *qemu_anon_ram_alloc(size_t size, uint64_t *align)
{
void *ptr;
@ -91,50 +91,6 @@ void qemu_anon_ram_free(void *ptr, size_t size)
}
}
/* FIXME: add proper locking */
struct tm *gmtime_r(const time_t *timep, struct tm *result)
{
struct tm *p = gmtime(timep);
memset(result, 0, sizeof(*result));
if (p) {
*result = *p;
p = result;
}
return p;
}
/* FIXME: add proper locking */
struct tm *localtime_r(const time_t *timep, struct tm *result)
{
struct tm *p = localtime(timep);
memset(result, 0, sizeof(*result));
if (p) {
*result = *p;
p = result;
}
return p;
}
/* Offset between 1/1/1601 and 1/1/1970 in 100 nanosec units */
#define _W32_FT_OFFSET (116444736000000000ULL)
int qemu_gettimeofday(qemu_timeval *tp)
{
union {
unsigned long long ns100; /*time since 1 Jan 1601 in 100ns units */
FILETIME ft;
} _now;
if(tp) {
GetSystemTimeAsFileTime (&_now.ft);
tp->tv_usec=(long)((_now.ns100 / 10ULL) % 1000000ULL );
tp->tv_sec= (long)((_now.ns100 - _W32_FT_OFFSET) / 10000000ULL);
}
/* Always return 0 as per Open Group Base Specifications Issue 6.
Do not set errno on error. */
return 0;
}
size_t getpagesize(void)
{
SYSTEM_INFO system_info;