More consolidation of timezone code:

* dropped DaylightSavingTime from real_time_clock code in kernel, it was
  never really being used for what it meant (and just being referred to by
  gettimeofday(), which put a different meaning to it
* adjusted the syscalls get_timezone() & set_timezone() as well as their callers 
  accordingly
* got rid of get_rtc_info() and rtc_info struct in kernel, as it was only
  being referred to by the FAT add-on and that one (like gettimeofday()) put a
  different meaning to tz_minuteswest. Added a comment to FAT's util.c
  showing a possible solution, should the hardcoded GMT timezone pose a problem.
* fixed declaration of gettimeofday() to match POSIX base specs, issue 7
* changed implementation of gettimeofday() to not bother trying to fill struct
  timezone - it was using wrong values before, anyway.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@37888 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Oliver Tappe
2010-08-03 23:02:57 +00:00
parent f8751b1fe6
commit 7e965f506d
8 changed files with 27 additions and 75 deletions
+2 -12
View File
@@ -15,14 +15,6 @@
#define RTC_EPOCH_BASE_YEAR 1970
typedef struct rtc_info {
uint32 time;
bool is_gmt;
int32 tz_minuteswest;
bool tz_dsttime;
} rtc_info;
#ifdef __cplusplus
extern "C" {
#endif
@@ -31,8 +23,6 @@ status_t rtc_init(kernel_args *args);
bigtime_t rtc_boot_time(void);
// Returns the time at which the system was booted in microseconds since Jan 1, 1970 UTC.
status_t get_rtc_info(rtc_info *info);
// Both functions use the passed struct tm only partially
// (no tm_wday, tm_yday, tm_isdst).
uint32 rtc_tm_to_secs(const struct tm *t);
@@ -40,8 +30,8 @@ void rtc_secs_to_tm(uint32 seconds, struct tm *t);
bigtime_t _user_system_time(void);
status_t _user_set_real_time_clock(uint32 time);
status_t _user_set_timezone(int32 timezoneOffset, bool daylightSavingTime);
status_t _user_get_timezone(int32 *_timezoneOffset, bool *_daylightSavingTime);
status_t _user_set_timezone(int32 timezoneOffset);
status_t _user_get_timezone(int32 *_timezoneOffset);
status_t _user_set_real_time_clock_is_gmt(bool isGMT);
status_t _user_get_real_time_clock_is_gmt(bool *_isGMT);