btrfs: [] on the end of a struct field is a variable length array.
[haiku.git] / headers / private / kernel / real_time_clock.h
blobccfd1177a00bda30ab774cc6731313c514a1c01a
1 /*
2 * Copyright 2006-2007, Axel Dörfler, axeld@pinc-software.de. All rights reserved.
3 * Copyright 2003, Jeff Ward, jeff@r2d2.stcloudstate.edu. All rights reserved.
5 * Distributed under the terms of the MIT License.
6 */
7 #ifndef _KERNEL_REAL_TIME_CLOCK_H
8 #define _KERNEL_REAL_TIME_CLOCK_H
11 #include <KernelExport.h>
13 #include <time.h>
16 struct kernel_args;
19 #define RTC_EPOCH_BASE_YEAR 1970
21 #ifdef __cplusplus
22 extern "C" {
23 #endif
25 void set_real_time_clock_usecs(bigtime_t currentTime);
27 status_t rtc_init(struct kernel_args *args);
28 bigtime_t rtc_boot_time(void);
29 // Returns the time at which the system was booted in microseconds since Jan 1, 1970 UTC.
31 // Both functions use the passed struct tm only partially
32 // (no tm_wday, tm_yday, tm_isdst).
33 uint32 rtc_tm_to_secs(const struct tm *t);
34 void rtc_secs_to_tm(uint32 seconds, struct tm *t);
36 uint32 get_timezone_offset(void);
38 bigtime_t _user_system_time(void);
39 status_t _user_set_real_time_clock(bigtime_t time);
40 status_t _user_set_timezone(int32 timezoneOffset, const char *name,
41 size_t nameLength);
42 status_t _user_get_timezone(int32 *_timezoneOffset, char* name,
43 size_t nameLength);
44 status_t _user_set_real_time_clock_is_gmt(bool isGMT);
45 status_t _user_get_real_time_clock_is_gmt(bool *_isGMT);
47 #ifdef __cplusplus
49 #endif
51 #endif /* _KERNEL_REAL_TIME_CLOCK_H */