Fix system call related date builtin functions

Related issues: #213, #691
 * Fixed 'ecma_date_local_tza' and 'ecma_date_daylight_saving_ta' date builtin helper functions
 * Added syscall of gettimeofday function to get the current system time and timezone.
 * Fixed related regression test files.

JerryScript-DCO-1.0-Signed-off-by: László Langó llango.u-szeged@partner.samsung.com
This commit is contained in:
László Langó
2016-02-11 12:03:11 +00:00
parent a7715a5d78
commit 684ed7268c
11 changed files with 163 additions and 56 deletions
+15 -1
View File
@@ -1,4 +1,5 @@
/* Copyright 2014-2015 Samsung Electronics Co., Ltd.
/* Copyright 2014-2016 Samsung Electronics Co., Ltd.
* Copyright 2016 University of Szeged.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -28,6 +29,7 @@
#include <sys/resource.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <time.h>
#include "jerry-libc-defs.h"
@@ -384,6 +386,18 @@ fwrite (const void *ptr, /**< data to write */
return bytes_written / size;
} /* fwrite */
/**
* This function can get the time as well as a timezone.
*
* @return 0 if success, -1 otherwise
*/
int
gettimeofday (void *tp, /**< struct timeval */
void *tzp) /**< struct timezone */
{
return (int) syscall_2 (__NR_gettimeofday, (long int) tp, (long int) tzp);
} /* gettimeofday */
// FIXME
#if 0
/**