VirtualBox

source: vbox/trunk/include/iprt/time.h@ 76327

Last change on this file since 76327 was 75665, checked in by vboxsync, 6 years ago

iprt: adjust time-r0drv-linux.c for Linux 4.20.
bugref:4567: Linux kernel driver maintainance.
Routine ktime_get_real_ts() must be replaced by ktime_get_real_ts64().
Thank you Larry Finger for the patch. (Adjusted before applying.)

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 36.7 KB
Line 
1/** @file
2 * IPRT - Time.
3 */
4
5/*
6 * Copyright (C) 2006-2017 Oracle Corporation
7 *
8 * This file is part of VirtualBox Open Source Edition (OSE), as
9 * available from http://www.virtualbox.org. This file is free software;
10 * you can redistribute it and/or modify it under the terms of the GNU
11 * General Public License (GPL) as published by the Free Software
12 * Foundation, in version 2 as it comes in the "COPYING" file of the
13 * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
14 * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
15 *
16 * The contents of this file may alternatively be used under the terms
17 * of the Common Development and Distribution License Version 1.0
18 * (CDDL) only, as it comes in the "COPYING.CDDL" file of the
19 * VirtualBox OSE distribution, in which case the provisions of the
20 * CDDL are applicable instead of those of the GPL.
21 *
22 * You may elect to license modified versions of this file under the
23 * terms and conditions of either the GPL or the CDDL or both.
24 */
25
26#ifndef ___iprt_time_h
27#define ___iprt_time_h
28
29#include <iprt/cdefs.h>
30#include <iprt/types.h>
31#include <iprt/assertcompile.h>
32
33RT_C_DECLS_BEGIN
34
35/** @defgroup grp_rt_time RTTime - Time
36 * @ingroup grp_rt
37 * @{
38 */
39
40/** Time Specification.
41 *
42 * Use the inline RTTimeSpecGet/Set to operate on structure this so we
43 * can easily change the representation if required later.
44 *
45 * The current representation is in nanoseconds relative to the unix epoch
46 * (1970-01-01 00:00:00 UTC). This gives us an approximate span from
47 * 1678 to 2262 without sacrificing the resolution offered by the various
48 * host OSes (BSD & LINUX 1ns, NT 100ns).
49 */
50typedef struct RTTIMESPEC
51{
52 /** Nanoseconds since epoch.
53 * The name is intentially too long to be comfortable to use because you should be
54 * using inline helpers! */
55 int64_t i64NanosecondsRelativeToUnixEpoch;
56} RTTIMESPEC;
57
58
59/** @name RTTIMESPEC methods
60 * @{ */
61
62/**
63 * Gets the time as nanoseconds relative to the unix epoch.
64 *
65 * @returns Nanoseconds relative to unix epoch.
66 * @param pTime The time spec to interpret.
67 */
68DECLINLINE(int64_t) RTTimeSpecGetNano(PCRTTIMESPEC pTime)
69{
70 return pTime->i64NanosecondsRelativeToUnixEpoch;
71}
72
73
74/**
75 * Sets the time give by nanoseconds relative to the unix epoch.
76 *
77 * @returns pTime.
78 * @param pTime The time spec to modify.
79 * @param i64Nano The new time in nanoseconds.
80 */
81DECLINLINE(PRTTIMESPEC) RTTimeSpecSetNano(PRTTIMESPEC pTime, int64_t i64Nano)
82{
83 pTime->i64NanosecondsRelativeToUnixEpoch = i64Nano;
84 return pTime;
85}
86
87
88/**
89 * Gets the time as microseconds relative to the unix epoch.
90 *
91 * @returns microseconds relative to unix epoch.
92 * @param pTime The time spec to interpret.
93 */
94DECLINLINE(int64_t) RTTimeSpecGetMicro(PCRTTIMESPEC pTime)
95{
96 return pTime->i64NanosecondsRelativeToUnixEpoch / RT_NS_1US;
97}
98
99
100/**
101 * Sets the time given by microseconds relative to the unix epoch.
102 *
103 * @returns pTime.
104 * @param pTime The time spec to modify.
105 * @param i64Micro The new time in microsecond.
106 */
107DECLINLINE(PRTTIMESPEC) RTTimeSpecSetMicro(PRTTIMESPEC pTime, int64_t i64Micro)
108{
109 pTime->i64NanosecondsRelativeToUnixEpoch = i64Micro * RT_NS_1US;
110 return pTime;
111}
112
113
114/**
115 * Gets the time as milliseconds relative to the unix epoch.
116 *
117 * @returns milliseconds relative to unix epoch.
118 * @param pTime The time spec to interpret.
119 */
120DECLINLINE(int64_t) RTTimeSpecGetMilli(PCRTTIMESPEC pTime)
121{
122 return pTime->i64NanosecondsRelativeToUnixEpoch / RT_NS_1MS;
123}
124
125
126/**
127 * Sets the time given by milliseconds relative to the unix epoch.
128 *
129 * @returns pTime.
130 * @param pTime The time spec to modify.
131 * @param i64Milli The new time in milliseconds.
132 */
133DECLINLINE(PRTTIMESPEC) RTTimeSpecSetMilli(PRTTIMESPEC pTime, int64_t i64Milli)
134{
135 pTime->i64NanosecondsRelativeToUnixEpoch = i64Milli * RT_NS_1MS;
136 return pTime;
137}
138
139
140/**
141 * Gets the time as seconds relative to the unix epoch.
142 *
143 * @returns seconds relative to unix epoch.
144 * @param pTime The time spec to interpret.
145 */
146DECLINLINE(int64_t) RTTimeSpecGetSeconds(PCRTTIMESPEC pTime)
147{
148 return pTime->i64NanosecondsRelativeToUnixEpoch / RT_NS_1SEC;
149}
150
151
152/**
153 * Sets the time given by seconds relative to the unix epoch.
154 *
155 * @returns pTime.
156 * @param pTime The time spec to modify.
157 * @param i64Seconds The new time in seconds.
158 */
159DECLINLINE(PRTTIMESPEC) RTTimeSpecSetSeconds(PRTTIMESPEC pTime, int64_t i64Seconds)
160{
161 pTime->i64NanosecondsRelativeToUnixEpoch = i64Seconds * RT_NS_1SEC;
162 return pTime;
163}
164
165
166/**
167 * Makes the time spec absolute like abs() does (i.e. a positive value).
168 *
169 * @returns pTime.
170 * @param pTime The time spec to modify.
171 */
172DECLINLINE(PRTTIMESPEC) RTTimeSpecAbsolute(PRTTIMESPEC pTime)
173{
174 if (pTime->i64NanosecondsRelativeToUnixEpoch < 0)
175 pTime->i64NanosecondsRelativeToUnixEpoch = -pTime->i64NanosecondsRelativeToUnixEpoch;
176 return pTime;
177}
178
179
180/**
181 * Negates the time.
182 *
183 * @returns pTime.
184 * @param pTime The time spec to modify.
185 */
186DECLINLINE(PRTTIMESPEC) RTTimeSpecNegate(PRTTIMESPEC pTime)
187{
188 pTime->i64NanosecondsRelativeToUnixEpoch = -pTime->i64NanosecondsRelativeToUnixEpoch;
189 return pTime;
190}
191
192
193/**
194 * Adds a time period to the time.
195 *
196 * @returns pTime.
197 * @param pTime The time spec to modify.
198 * @param pTimeAdd The time spec to add to pTime.
199 */
200DECLINLINE(PRTTIMESPEC) RTTimeSpecAdd(PRTTIMESPEC pTime, PCRTTIMESPEC pTimeAdd)
201{
202 pTime->i64NanosecondsRelativeToUnixEpoch += pTimeAdd->i64NanosecondsRelativeToUnixEpoch;
203 return pTime;
204}
205
206
207/**
208 * Adds a time period give as nanoseconds from the time.
209 *
210 * @returns pTime.
211 * @param pTime The time spec to modify.
212 * @param i64Nano The time period in nanoseconds.
213 */
214DECLINLINE(PRTTIMESPEC) RTTimeSpecAddNano(PRTTIMESPEC pTime, int64_t i64Nano)
215{
216 pTime->i64NanosecondsRelativeToUnixEpoch += i64Nano;
217 return pTime;
218}
219
220
221/**
222 * Adds a time period give as microseconds from the time.
223 *
224 * @returns pTime.
225 * @param pTime The time spec to modify.
226 * @param i64Micro The time period in microseconds.
227 */
228DECLINLINE(PRTTIMESPEC) RTTimeSpecAddMicro(PRTTIMESPEC pTime, int64_t i64Micro)
229{
230 pTime->i64NanosecondsRelativeToUnixEpoch += i64Micro * RT_NS_1US;
231 return pTime;
232}
233
234
235/**
236 * Adds a time period give as milliseconds from the time.
237 *
238 * @returns pTime.
239 * @param pTime The time spec to modify.
240 * @param i64Milli The time period in milliseconds.
241 */
242DECLINLINE(PRTTIMESPEC) RTTimeSpecAddMilli(PRTTIMESPEC pTime, int64_t i64Milli)
243{
244 pTime->i64NanosecondsRelativeToUnixEpoch += i64Milli * RT_NS_1MS;
245 return pTime;
246}
247
248
249/**
250 * Adds a time period give as seconds from the time.
251 *
252 * @returns pTime.
253 * @param pTime The time spec to modify.
254 * @param i64Seconds The time period in seconds.
255 */
256DECLINLINE(PRTTIMESPEC) RTTimeSpecAddSeconds(PRTTIMESPEC pTime, int64_t i64Seconds)
257{
258 pTime->i64NanosecondsRelativeToUnixEpoch += i64Seconds * RT_NS_1SEC;
259 return pTime;
260}
261
262
263/**
264 * Subtracts a time period from the time.
265 *
266 * @returns pTime.
267 * @param pTime The time spec to modify.
268 * @param pTimeSub The time spec to subtract from pTime.
269 */
270DECLINLINE(PRTTIMESPEC) RTTimeSpecSub(PRTTIMESPEC pTime, PCRTTIMESPEC pTimeSub)
271{
272 pTime->i64NanosecondsRelativeToUnixEpoch -= pTimeSub->i64NanosecondsRelativeToUnixEpoch;
273 return pTime;
274}
275
276
277/**
278 * Subtracts a time period give as nanoseconds from the time.
279 *
280 * @returns pTime.
281 * @param pTime The time spec to modify.
282 * @param i64Nano The time period in nanoseconds.
283 */
284DECLINLINE(PRTTIMESPEC) RTTimeSpecSubNano(PRTTIMESPEC pTime, int64_t i64Nano)
285{
286 pTime->i64NanosecondsRelativeToUnixEpoch -= i64Nano;
287 return pTime;
288}
289
290
291/**
292 * Subtracts a time period give as microseconds from the time.
293 *
294 * @returns pTime.
295 * @param pTime The time spec to modify.
296 * @param i64Micro The time period in microseconds.
297 */
298DECLINLINE(PRTTIMESPEC) RTTimeSpecSubMicro(PRTTIMESPEC pTime, int64_t i64Micro)
299{
300 pTime->i64NanosecondsRelativeToUnixEpoch -= i64Micro * RT_NS_1US;
301 return pTime;
302}
303
304
305/**
306 * Subtracts a time period give as milliseconds from the time.
307 *
308 * @returns pTime.
309 * @param pTime The time spec to modify.
310 * @param i64Milli The time period in milliseconds.
311 */
312DECLINLINE(PRTTIMESPEC) RTTimeSpecSubMilli(PRTTIMESPEC pTime, int64_t i64Milli)
313{
314 pTime->i64NanosecondsRelativeToUnixEpoch -= i64Milli * RT_NS_1MS;
315 return pTime;
316}
317
318
319/**
320 * Subtracts a time period give as seconds from the time.
321 *
322 * @returns pTime.
323 * @param pTime The time spec to modify.
324 * @param i64Seconds The time period in seconds.
325 */
326DECLINLINE(PRTTIMESPEC) RTTimeSpecSubSeconds(PRTTIMESPEC pTime, int64_t i64Seconds)
327{
328 pTime->i64NanosecondsRelativeToUnixEpoch -= i64Seconds * RT_NS_1SEC;
329 return pTime;
330}
331
332
333/**
334 * Gives the time in seconds and nanoseconds.
335 *
336 * @returns pTime.
337 * @param pTime The time spec to interpret.
338 * @param *pi32Seconds Where to store the time period in seconds.
339 * @param *pi32Nano Where to store the time period in nanoseconds.
340 */
341DECLINLINE(void) RTTimeSpecGetSecondsAndNano(PRTTIMESPEC pTime, int32_t *pi32Seconds, int32_t *pi32Nano)
342{
343 int64_t i64 = RTTimeSpecGetNano(pTime);
344 int32_t i32Nano = (int32_t)(i64 % RT_NS_1SEC);
345 i64 /= RT_NS_1SEC;
346 if (i32Nano < 0)
347 {
348 i32Nano += RT_NS_1SEC;
349 i64--;
350 }
351 *pi32Seconds = (int32_t)i64;
352 *pi32Nano = i32Nano;
353}
354
355
356/* PORTME: Add struct timeval guard macro here. */
357#if defined(RTTIME_INCL_TIMEVAL) || defined(_STRUCT_TIMEVAL) || defined(_SYS__TIMEVAL_H_) || defined(_SYS_TIME_H) || defined(_TIMEVAL) || defined(_LINUX_TIME_H) \
358 || (defined(RT_OS_NETBSD) && defined(_SYS_TIME_H_))
359/**
360 * Gets the time as POSIX timeval.
361 *
362 * @returns pTime.
363 * @param pTime The time spec to interpret.
364 * @param pTimeval Where to store the time as POSIX timeval.
365 */
366DECLINLINE(struct timeval *) RTTimeSpecGetTimeval(PCRTTIMESPEC pTime, struct timeval *pTimeval)
367{
368 int64_t i64 = RTTimeSpecGetMicro(pTime);
369 int32_t i32Micro = (int32_t)(i64 % RT_US_1SEC);
370 i64 /= RT_US_1SEC;
371 if (i32Micro < 0)
372 {
373 i32Micro += RT_US_1SEC;
374 i64--;
375 }
376 pTimeval->tv_sec = (time_t)i64;
377 pTimeval->tv_usec = i32Micro;
378 return pTimeval;
379}
380
381/**
382 * Sets the time as POSIX timeval.
383 *
384 * @returns pTime.
385 * @param pTime The time spec to modify.
386 * @param pTimeval Pointer to the POSIX timeval struct with the new time.
387 */
388DECLINLINE(PRTTIMESPEC) RTTimeSpecSetTimeval(PRTTIMESPEC pTime, const struct timeval *pTimeval)
389{
390 return RTTimeSpecAddMicro(RTTimeSpecSetSeconds(pTime, pTimeval->tv_sec), pTimeval->tv_usec);
391}
392#endif /* various ways of detecting struct timeval */
393
394
395/* PORTME: Add struct timespec guard macro here. */
396#if defined(RTTIME_INCL_TIMESPEC) || defined(_STRUCT_TIMESPEC) || defined(_SYS__TIMESPEC_H_) || defined(TIMEVAL_TO_TIMESPEC) || defined(_TIMESPEC) \
397 || (defined(RT_OS_NETBSD) && defined(_SYS_TIME_H_))
398/**
399 * Gets the time as POSIX timespec.
400 *
401 * @returns pTime.
402 * @param pTime The time spec to interpret.
403 * @param pTimespec Where to store the time as POSIX timespec.
404 */
405DECLINLINE(struct timespec *) RTTimeSpecGetTimespec(PCRTTIMESPEC pTime, struct timespec *pTimespec)
406{
407 int64_t i64 = RTTimeSpecGetNano(pTime);
408 int32_t i32Nano = (int32_t)(i64 % RT_NS_1SEC);
409 i64 /= RT_NS_1SEC;
410 if (i32Nano < 0)
411 {
412 i32Nano += RT_NS_1SEC;
413 i64--;
414 }
415 pTimespec->tv_sec = (time_t)i64;
416 pTimespec->tv_nsec = i32Nano;
417 return pTimespec;
418}
419
420/**
421 * Sets the time as POSIX timespec.
422 *
423 * @returns pTime.
424 * @param pTime The time spec to modify.
425 * @param pTimespec Pointer to the POSIX timespec struct with the new time.
426 */
427DECLINLINE(PRTTIMESPEC) RTTimeSpecSetTimespec(PRTTIMESPEC pTime, const struct timespec *pTimespec)
428{
429 return RTTimeSpecAddNano(RTTimeSpecSetSeconds(pTime, pTimespec->tv_sec), pTimespec->tv_nsec);
430}
431
432
433# ifdef _LINUX_TIME64_H
434DECLINLINE(PRTTIMESPEC) RTTimeSpecSetTimespec64(PRTTIMESPEC pTime, const struct timespec64 *pTimeval)
435{
436 return RTTimeSpecAddNano(RTTimeSpecSetSeconds(pTime, pTimeval->tv_sec), pTimeval->tv_nsec);
437}
438# endif
439#endif /* various ways of detecting struct timespec */
440
441
442
443/** The offset of the unix epoch and the base for NT time (in 100ns units).
444 * Nt time starts at 1601-01-01 00:00:00. */
445#define RTTIME_NT_TIME_OFFSET_UNIX (116444736000000000LL)
446
447
448/**
449 * Gets the time as NT time.
450 *
451 * @returns Nt time.
452 * @param pTime The time spec to interpret.
453 */
454DECLINLINE(uint64_t) RTTimeSpecGetNtTime(PCRTTIMESPEC pTime)
455{
456 return pTime->i64NanosecondsRelativeToUnixEpoch / 100
457 + RTTIME_NT_TIME_OFFSET_UNIX;
458}
459
460
461/**
462 * Sets the time given by Nt time.
463 *
464 * @returns pTime.
465 * @param pTime The time spec to modify.
466 * @param u64NtTime The new time in Nt time.
467 */
468DECLINLINE(PRTTIMESPEC) RTTimeSpecSetNtTime(PRTTIMESPEC pTime, uint64_t u64NtTime)
469{
470 pTime->i64NanosecondsRelativeToUnixEpoch =
471 ((int64_t)u64NtTime - RTTIME_NT_TIME_OFFSET_UNIX) * 100;
472 return pTime;
473}
474
475
476#ifdef _FILETIME_
477/**
478 * Gets the time as NT file time.
479 *
480 * @returns pFileTime.
481 * @param pTime The time spec to interpret.
482 * @param pFileTime Pointer to NT filetime structure.
483 */
484DECLINLINE(PFILETIME) RTTimeSpecGetNtFileTime(PCRTTIMESPEC pTime, PFILETIME pFileTime)
485{
486 *((uint64_t *)pFileTime) = RTTimeSpecGetNtTime(pTime);
487 return pFileTime;
488}
489
490/**
491 * Sets the time as NT file time.
492 *
493 * @returns pTime.
494 * @param pTime The time spec to modify.
495 * @param pFileTime Where to store the time as Nt file time.
496 */
497DECLINLINE(PRTTIMESPEC) RTTimeSpecSetNtFileTime(PRTTIMESPEC pTime, const FILETIME *pFileTime)
498{
499 return RTTimeSpecSetNtTime(pTime, *(const uint64_t *)pFileTime);
500}
501#endif
502
503
504/** The offset to the start of DOS time.
505 * DOS time starts 1980-01-01 00:00:00. */
506#define RTTIME_OFFSET_DOS_TIME (315532800000000000LL)
507
508
509/**
510 * Gets the time as seconds relative to the start of dos time.
511 *
512 * @returns seconds relative to the start of dos time.
513 * @param pTime The time spec to interpret.
514 */
515DECLINLINE(int64_t) RTTimeSpecGetDosSeconds(PCRTTIMESPEC pTime)
516{
517 return (pTime->i64NanosecondsRelativeToUnixEpoch - RTTIME_OFFSET_DOS_TIME)
518 / RT_NS_1SEC;
519}
520
521
522/**
523 * Sets the time given by seconds relative to the start of dos time.
524 *
525 * @returns pTime.
526 * @param pTime The time spec to modify.
527 * @param i64Seconds The new time in seconds relative to the start of dos time.
528 */
529DECLINLINE(PRTTIMESPEC) RTTimeSpecSetDosSeconds(PRTTIMESPEC pTime, int64_t i64Seconds)
530{
531 pTime->i64NanosecondsRelativeToUnixEpoch = i64Seconds * RT_NS_1SEC
532 + RTTIME_OFFSET_DOS_TIME;
533 return pTime;
534}
535
536
537/**
538 * Compare two time specs.
539 *
540 * @returns true they are equal.
541 * @returns false they are not equal.
542 * @param pTime1 The 1st time spec.
543 * @param pTime2 The 2nd time spec.
544 */
545DECLINLINE(bool) RTTimeSpecIsEqual(PCRTTIMESPEC pTime1, PCRTTIMESPEC pTime2)
546{
547 return pTime1->i64NanosecondsRelativeToUnixEpoch == pTime2->i64NanosecondsRelativeToUnixEpoch;
548}
549
550
551/**
552 * Compare two time specs.
553 *
554 * @returns 0 if equal, -1 if @a pLeft is smaller, 1 if @a pLeft is larger.
555 * @returns false they are not equal.
556 * @param pLeft The 1st time spec.
557 * @param pRight The 2nd time spec.
558 */
559DECLINLINE(int) RTTimeSpecCompare(PCRTTIMESPEC pLeft, PCRTTIMESPEC pRight)
560{
561 if (pLeft->i64NanosecondsRelativeToUnixEpoch == pRight->i64NanosecondsRelativeToUnixEpoch)
562 return 0;
563 return pLeft->i64NanosecondsRelativeToUnixEpoch < pRight->i64NanosecondsRelativeToUnixEpoch ? -1 : 1;
564}
565
566
567/**
568 * Converts a time spec to a ISO date string.
569 *
570 * @returns psz on success.
571 * @returns NULL on buffer underflow.
572 * @param pTime The time spec.
573 * @param psz Where to store the string.
574 * @param cb The size of the buffer.
575 */
576RTDECL(char *) RTTimeSpecToString(PCRTTIMESPEC pTime, char *psz, size_t cb);
577
578/**
579 * Attempts to convert an ISO date string to a time structure.
580 *
581 * We're a little forgiving with zero padding, unspecified parts, and leading
582 * and trailing spaces.
583 *
584 * @retval pTime on success,
585 * @retval NULL on failure.
586 * @param pTime The time spec.
587 * @param pszString The ISO date string to convert.
588 */
589RTDECL(PRTTIMESPEC) RTTimeSpecFromString(PRTTIMESPEC pTime, const char *pszString);
590
591/** @} */
592
593
594/**
595 * Exploded time.
596 */
597typedef struct RTTIME
598{
599 /** The year number. */
600 int32_t i32Year;
601 /** The month of the year (1-12). January is 1. */
602 uint8_t u8Month;
603 /** The day of the week (0-6). Monday is 0. */
604 uint8_t u8WeekDay;
605 /** The day of the year (1-366). January the 1st is 1. */
606 uint16_t u16YearDay;
607 /** The day of the month (1-31). */
608 uint8_t u8MonthDay;
609 /** Hour of the day (0-23). */
610 uint8_t u8Hour;
611 /** The minute of the hour (0-59). */
612 uint8_t u8Minute;
613 /** The second of the minute (0-60).
614 * (u32Nanosecond / 1000000) */
615 uint8_t u8Second;
616 /** The nanoseconds of the second (0-999999999). */
617 uint32_t u32Nanosecond;
618 /** Flags, of the RTTIME_FLAGS_* \#defines. */
619 uint32_t fFlags;
620 /** UCT time offset in minutes (-840-840). Positive for timezones east of
621 * UTC, negative for zones to the west. Same as what RTTimeLocalDeltaNano
622 * & RTTimeLocalDeltaNanoFor returns, just different unit. */
623 int32_t offUTC;
624} RTTIME;
625AssertCompileSize(RTTIME, 24);
626/** Pointer to a exploded time structure. */
627typedef RTTIME *PRTTIME;
628/** Pointer to a const exploded time structure. */
629typedef const RTTIME *PCRTTIME;
630
631/** @name RTTIME::fFlags values.
632 * @{ */
633/** Set if the time is UTC. If clear the time local time. */
634#define RTTIME_FLAGS_TYPE_MASK 3
635/** the time is UTC time. */
636#define RTTIME_FLAGS_TYPE_UTC 2
637/** The time is local time. */
638#define RTTIME_FLAGS_TYPE_LOCAL 3
639
640/** Set if the time is local and daylight saving time is in effect.
641 * Not bit is not valid if RTTIME_FLAGS_NO_DST_DATA is set. */
642#define RTTIME_FLAGS_DST RT_BIT(4)
643/** Set if the time is local and there is no data available on daylight saving time. */
644#define RTTIME_FLAGS_NO_DST_DATA RT_BIT(5)
645/** Set if the year is a leap year.
646 * This is mutual exclusiv with RTTIME_FLAGS_COMMON_YEAR. */
647#define RTTIME_FLAGS_LEAP_YEAR RT_BIT(6)
648/** Set if the year is a common year.
649 * This is mutual exclusiv with RTTIME_FLAGS_LEAP_YEAR. */
650#define RTTIME_FLAGS_COMMON_YEAR RT_BIT(7)
651/** The mask of valid flags. */
652#define RTTIME_FLAGS_MASK UINT32_C(0xff)
653/** @} */
654
655
656/**
657 * Gets the current system time (UTC).
658 *
659 * @returns pTime.
660 * @param pTime Where to store the time.
661 */
662RTDECL(PRTTIMESPEC) RTTimeNow(PRTTIMESPEC pTime);
663
664/**
665 * Sets the system time.
666 *
667 * @returns IPRT status code
668 * @param pTime The new system time (UTC).
669 *
670 * @remarks This will usually fail because changing the wall time is usually
671 * requires extra privileges.
672 */
673RTDECL(int) RTTimeSet(PCRTTIMESPEC pTime);
674
675/**
676 * Explodes a time spec (UTC).
677 *
678 * @returns pTime.
679 * @param pTime Where to store the exploded time.
680 * @param pTimeSpec The time spec to exploded.
681 */
682RTDECL(PRTTIME) RTTimeExplode(PRTTIME pTime, PCRTTIMESPEC pTimeSpec);
683
684/**
685 * Implodes exploded time to a time spec (UTC).
686 *
687 * @returns pTime on success.
688 * @returns NULL if the pTime data is invalid.
689 * @param pTimeSpec Where to store the imploded UTC time.
690 * If pTime specifies a time which outside the range, maximum or
691 * minimum values will be returned.
692 * @param pTime Pointer to the exploded time to implode.
693 * The fields u8Month, u8WeekDay and u8MonthDay are not used,
694 * and all the other fields are expected to be within their
695 * bounds. Use RTTimeNormalize() to calculate u16YearDay and
696 * normalize the ranges of the fields.
697 */
698RTDECL(PRTTIMESPEC) RTTimeImplode(PRTTIMESPEC pTimeSpec, PCRTTIME pTime);
699
700/**
701 * Normalizes the fields of a time structure.
702 *
703 * It is possible to calculate year-day from month/day and vice
704 * versa. If you adjust any of of these, make sure to zero the
705 * other so you make it clear which of the fields to use. If
706 * it's ambiguous, the year-day field is used (and you get
707 * assertions in debug builds).
708 *
709 * All the time fields and the year-day or month/day fields will
710 * be adjusted for overflows. (Since all fields are unsigned, there
711 * is no underflows.) It is possible to exploit this for simple
712 * date math, though the recommended way of doing that to implode
713 * the time into a timespec and do the math on that.
714 *
715 * @returns pTime on success.
716 * @returns NULL if the data is invalid.
717 *
718 * @param pTime The time structure to normalize.
719 *
720 * @remarks This function doesn't work with local time, only with UTC time.
721 */
722RTDECL(PRTTIME) RTTimeNormalize(PRTTIME pTime);
723
724/**
725 * Gets the current local system time.
726 *
727 * @returns pTime.
728 * @param pTime Where to store the local time.
729 */
730RTDECL(PRTTIMESPEC) RTTimeLocalNow(PRTTIMESPEC pTime);
731
732/**
733 * Gets the current delta between UTC and local time.
734 *
735 * @code
736 * RTTIMESPEC LocalTime;
737 * RTTimeSpecAddNano(RTTimeNow(&LocalTime), RTTimeLocalDeltaNano());
738 * @endcode
739 *
740 * @returns Returns the nanosecond delta between UTC and local time.
741 */
742RTDECL(int64_t) RTTimeLocalDeltaNano(void);
743
744/**
745 * Gets the delta between UTC and local time at the given time.
746 *
747 * @code
748 * RTTIMESPEC LocalTime;
749 * RTTimeNow(&LocalTime);
750 * RTTimeSpecAddNano(&LocalTime, RTTimeLocalDeltaNanoFor(&LocalTime));
751 * @endcode
752 *
753 * @param pTimeSpec The time spec giving the time to get the delta for.
754 * @returns Returns the nanosecond delta between UTC and local time.
755 */
756RTDECL(int64_t) RTTimeLocalDeltaNanoFor(PCRTTIMESPEC pTimeSpec);
757
758/**
759 * Explodes a time spec to the localized timezone.
760 *
761 * @returns pTime.
762 * @param pTime Where to store the exploded time.
763 * @param pTimeSpec The time spec to exploded (UTC).
764 */
765RTDECL(PRTTIME) RTTimeLocalExplode(PRTTIME pTime, PCRTTIMESPEC pTimeSpec);
766
767/**
768 * Normalizes the fields of a time structure containing local time.
769 *
770 * See RTTimeNormalize for details.
771 *
772 * @returns pTime on success.
773 * @returns NULL if the data is invalid.
774 * @param pTime The time structure to normalize.
775 */
776RTDECL(PRTTIME) RTTimeLocalNormalize(PRTTIME pTime);
777
778/**
779 * Converts a time structure to UTC, relying on UTC offset information
780 * if it contains local time.
781 *
782 * @returns pTime on success.
783 * @returns NULL if the data is invalid.
784 * @param pTime The time structure to convert.
785 */
786RTDECL(PRTTIME) RTTimeConvertToZulu(PRTTIME pTime);
787
788/**
789 * Converts a time spec to a ISO date string.
790 *
791 * @returns psz on success.
792 * @returns NULL on buffer underflow.
793 * @param pTime The time. Caller should've normalized this.
794 * @param psz Where to store the string.
795 * @param cb The size of the buffer.
796 */
797RTDECL(char *) RTTimeToString(PCRTTIME pTime, char *psz, size_t cb);
798
799/**
800 * Converts a time spec to a ISO date string, extended version.
801 *
802 * @returns Output string length on success (positive), VERR_BUFFER_OVERFLOW
803 * (negative) or VERR_OUT_OF_RANGE (negative) on failure.
804 * @param pTime The time. Caller should've normalized this.
805 * @param psz Where to store the string.
806 * @param cb The size of the buffer.
807 * @param cFractionDigits Number of digits in the fraction. Max is 9.
808 */
809RTDECL(ssize_t) RTTimeToStringEx(PCRTTIME pTime, char *psz, size_t cb, unsigned cFractionDigits);
810
811/** Suggested buffer length for RTTimeToString and RTTimeToStringEx output, including terminator. */
812#define RTTIME_STR_LEN 40
813
814/**
815 * Attempts to convert an ISO date string to a time structure.
816 *
817 * We're a little forgiving with zero padding, unspecified parts, and leading
818 * and trailing spaces.
819 *
820 * @retval pTime on success,
821 * @retval NULL on failure.
822 * @param pTime Where to store the time on success.
823 * @param pszString The ISO date string to convert.
824 */
825RTDECL(PRTTIME) RTTimeFromString(PRTTIME pTime, const char *pszString);
826
827/**
828 * Formats the given time on a RTC-2822 compliant format.
829 *
830 * @returns Output string length on success (positive), VERR_BUFFER_OVERFLOW
831 * (negative) on failure.
832 * @param pTime The time. Caller should've normalized this.
833 * @param psz Where to store the string.
834 * @param cb The size of the buffer.
835 * @param fFlags RTTIME_RFC2822_F_XXX
836 * @sa RTTIME_RFC2822_LEN
837 */
838RTDECL(ssize_t) RTTimeToRfc2822(PRTTIME pTime, char *psz, size_t cb, uint32_t fFlags);
839
840/** Suggested buffer length for RTTimeToRfc2822 output, including terminator. */
841#define RTTIME_RFC2822_LEN 40
842/** @name RTTIME_RFC2822_F_XXX
843 * @{ */
844/** Use the deprecated GMT timezone instead of +/-0000.
845 * This is required by the HTTP RFC-7231 7.1.1.1. */
846#define RTTIME_RFC2822_F_GMT RT_BIT_32(0)
847/** @} */
848
849/**
850 * Attempts to convert an RFC-2822 date string to a time structure.
851 *
852 * We're a little forgiving with zero padding, unspecified parts, and leading
853 * and trailing spaces.
854 *
855 * @retval pTime on success,
856 * @retval NULL on failure.
857 * @param pTime Where to store the time on success.
858 * @param pszString The ISO date string to convert.
859 */
860RTDECL(PRTTIME) RTTimeFromRfc2822(PRTTIME pTime, const char *pszString);
861
862/**
863 * Checks if a year is a leap year or not.
864 *
865 * @returns true if it's a leap year.
866 * @returns false if it's a common year.
867 * @param i32Year The year in question.
868 */
869RTDECL(bool) RTTimeIsLeapYear(int32_t i32Year);
870
871/**
872 * Compares two normalized time structures.
873 *
874 * @retval 0 if equal.
875 * @retval -1 if @a pLeft is earlier than @a pRight.
876 * @retval 1 if @a pRight is earlier than @a pLeft.
877 *
878 * @param pLeft The left side time. NULL is accepted.
879 * @param pRight The right side time. NULL is accepted.
880 *
881 * @note A NULL time is considered smaller than anything else. If both are
882 * NULL, they are considered equal.
883 */
884RTDECL(int) RTTimeCompare(PCRTTIME pLeft, PCRTTIME pRight);
885
886/**
887 * Gets the current nanosecond timestamp.
888 *
889 * @returns nanosecond timestamp.
890 */
891RTDECL(uint64_t) RTTimeNanoTS(void);
892
893/**
894 * Gets the current millisecond timestamp.
895 *
896 * @returns millisecond timestamp.
897 */
898RTDECL(uint64_t) RTTimeMilliTS(void);
899
900/**
901 * Debugging the time api.
902 *
903 * @returns the number of 1ns steps which has been applied by RTTimeNanoTS().
904 */
905RTDECL(uint32_t) RTTimeDbgSteps(void);
906
907/**
908 * Debugging the time api.
909 *
910 * @returns the number of times the TSC interval expired RTTimeNanoTS().
911 */
912RTDECL(uint32_t) RTTimeDbgExpired(void);
913
914/**
915 * Debugging the time api.
916 *
917 * @returns the number of bad previous values encountered by RTTimeNanoTS().
918 */
919RTDECL(uint32_t) RTTimeDbgBad(void);
920
921/**
922 * Debugging the time api.
923 *
924 * @returns the number of update races in RTTimeNanoTS().
925 */
926RTDECL(uint32_t) RTTimeDbgRaces(void);
927
928/** @name RTTimeNanoTS GIP worker functions, for TM.
929 * @{ */
930/** Pointer to a RTTIMENANOTSDATA structure. */
931typedef struct RTTIMENANOTSDATA *PRTTIMENANOTSDATA;
932
933/**
934 * Nanosecond timestamp data.
935 *
936 * This is used to keep track of statistics and callback so IPRT
937 * and TM (VirtualBox) can share code.
938 *
939 * @remark Keep this in sync with the assembly version in timesupA.asm.
940 */
941typedef struct RTTIMENANOTSDATA
942{
943 /** Where the previous timestamp is stored.
944 * This is maintained to ensure that time doesn't go backwards or anything. */
945 uint64_t volatile *pu64Prev;
946
947 /**
948 * Helper function that's used by the assembly routines when something goes bust.
949 *
950 * @param pData Pointer to this structure.
951 * @param u64NanoTS The calculated nano ts.
952 * @param u64DeltaPrev The delta relative to the previously returned timestamp.
953 * @param u64PrevNanoTS The previously returned timestamp (as it was read it).
954 */
955 DECLCALLBACKMEMBER(void, pfnBad)(PRTTIMENANOTSDATA pData, uint64_t u64NanoTS, uint64_t u64DeltaPrev, uint64_t u64PrevNanoTS);
956
957 /**
958 * Callback for when rediscovery is required.
959 *
960 * @returns Nanosecond timestamp.
961 * @param pData Pointer to this structure.
962 */
963 DECLCALLBACKMEMBER(uint64_t, pfnRediscover)(PRTTIMENANOTSDATA pData);
964
965 /**
966 * Callback for when some CPU index related stuff goes wrong.
967 *
968 * @returns Nanosecond timestamp.
969 * @param pData Pointer to this structure.
970 * @param idApic The APIC ID if available, otherwise (UINT16_MAX-1).
971 * @param iCpuSet The CPU set index if available, otherwise
972 * (UINT16_MAX-1).
973 * @param iGipCpu The GIP CPU array index if available, otherwise
974 * (UINT16_MAX-1).
975 */
976 DECLCALLBACKMEMBER(uint64_t, pfnBadCpuIndex)(PRTTIMENANOTSDATA pData, uint16_t idApic, uint16_t iCpuSet, uint16_t iGipCpu);
977
978 /** Number of 1ns steps because of overshooting the period. */
979 uint32_t c1nsSteps;
980 /** The number of times the interval expired (overflow). */
981 uint32_t cExpired;
982 /** Number of "bad" previous values. */
983 uint32_t cBadPrev;
984 /** The number of update races. */
985 uint32_t cUpdateRaces;
986} RTTIMENANOTSDATA;
987
988#ifndef IN_RING3
989/**
990 * The Ring-3 layout of the RTTIMENANOTSDATA structure.
991 */
992typedef struct RTTIMENANOTSDATAR3
993{
994 R3PTRTYPE(uint64_t volatile *) pu64Prev;
995 DECLR3CALLBACKMEMBER(void, pfnBad,(PRTTIMENANOTSDATA pData, uint64_t u64NanoTS, uint64_t u64DeltaPrev, uint64_t u64PrevNanoTS));
996 DECLR3CALLBACKMEMBER(uint64_t, pfnRediscover,(PRTTIMENANOTSDATA pData));
997 DECLR3CALLBACKMEMBER(uint64_t, pfnBadCpuIndex,(PRTTIMENANOTSDATA pData, uint16_t idApic, uint16_t iCpuSet, uint16_t iGipCpu));
998 uint32_t c1nsSteps;
999 uint32_t cExpired;
1000 uint32_t cBadPrev;
1001 uint32_t cUpdateRaces;
1002} RTTIMENANOTSDATAR3;
1003#else
1004typedef RTTIMENANOTSDATA RTTIMENANOTSDATAR3;
1005#endif
1006
1007#ifndef IN_RING0
1008/**
1009 * The Ring-3 layout of the RTTIMENANOTSDATA structure.
1010 */
1011typedef struct RTTIMENANOTSDATAR0
1012{
1013 R0PTRTYPE(uint64_t volatile *) pu64Prev;
1014 DECLR0CALLBACKMEMBER(void, pfnBad,(PRTTIMENANOTSDATA pData, uint64_t u64NanoTS, uint64_t u64DeltaPrev, uint64_t u64PrevNanoTS));
1015 DECLR0CALLBACKMEMBER(uint64_t, pfnRediscover,(PRTTIMENANOTSDATA pData));
1016 DECLR0CALLBACKMEMBER(uint64_t, pfnBadCpuIndex,(PRTTIMENANOTSDATA pData, uint16_t idApic, uint16_t iCpuSet, uint16_t iGipCpu));
1017 uint32_t c1nsSteps;
1018 uint32_t cExpired;
1019 uint32_t cBadPrev;
1020 uint32_t cUpdateRaces;
1021} RTTIMENANOTSDATAR0;
1022#else
1023typedef RTTIMENANOTSDATA RTTIMENANOTSDATAR0;
1024#endif
1025
1026#ifndef IN_RC
1027/**
1028 * The RC layout of the RTTIMENANOTSDATA structure.
1029 */
1030typedef struct RTTIMENANOTSDATARC
1031{
1032 RCPTRTYPE(uint64_t volatile *) pu64Prev;
1033 DECLRCCALLBACKMEMBER(void, pfnBad,(PRTTIMENANOTSDATA pData, uint64_t u64NanoTS, uint64_t u64DeltaPrev, uint64_t u64PrevNanoTS));
1034 DECLRCCALLBACKMEMBER(uint64_t, pfnRediscover,(PRTTIMENANOTSDATA pData));
1035 DECLRCCALLBACKMEMBER(uint64_t, pfnBadCpuIndex,(PRTTIMENANOTSDATA pData, uint16_t idApic, uint16_t iCpuSet, uint16_t iGipCpu));
1036 uint32_t c1nsSteps;
1037 uint32_t cExpired;
1038 uint32_t cBadPrev;
1039 uint32_t cUpdateRaces;
1040} RTTIMENANOTSDATARC;
1041#else
1042typedef RTTIMENANOTSDATA RTTIMENANOTSDATARC;
1043#endif
1044
1045/** Internal RTTimeNanoTS worker (assembly). */
1046typedef DECLCALLBACK(uint64_t) FNTIMENANOTSINTERNAL(PRTTIMENANOTSDATA pData);
1047/** Pointer to an internal RTTimeNanoTS worker (assembly). */
1048typedef FNTIMENANOTSINTERNAL *PFNTIMENANOTSINTERNAL;
1049RTDECL(uint64_t) RTTimeNanoTSLegacySyncInvarNoDelta(PRTTIMENANOTSDATA pData);
1050RTDECL(uint64_t) RTTimeNanoTSLFenceSyncInvarNoDelta(PRTTIMENANOTSDATA pData);
1051#ifdef IN_RING3
1052RTDECL(uint64_t) RTTimeNanoTSLegacyAsyncUseApicId(PRTTIMENANOTSDATA pData);
1053RTDECL(uint64_t) RTTimeNanoTSLegacyAsyncUseRdtscp(PRTTIMENANOTSDATA pData);
1054RTDECL(uint64_t) RTTimeNanoTSLegacyAsyncUseRdtscpGroupChNumCl(PRTTIMENANOTSDATA pData);
1055RTDECL(uint64_t) RTTimeNanoTSLegacyAsyncUseIdtrLim(PRTTIMENANOTSDATA pData);
1056RTDECL(uint64_t) RTTimeNanoTSLegacySyncInvarWithDeltaUseApicId(PRTTIMENANOTSDATA pData);
1057RTDECL(uint64_t) RTTimeNanoTSLegacySyncInvarWithDeltaUseRdtscp(PRTTIMENANOTSDATA pData);
1058RTDECL(uint64_t) RTTimeNanoTSLegacySyncInvarWithDeltaUseIdtrLim(PRTTIMENANOTSDATA pData);
1059RTDECL(uint64_t) RTTimeNanoTSLFenceAsyncUseApicId(PRTTIMENANOTSDATA pData);
1060RTDECL(uint64_t) RTTimeNanoTSLFenceAsyncUseRdtscp(PRTTIMENANOTSDATA pData);
1061RTDECL(uint64_t) RTTimeNanoTSLFenceAsyncUseRdtscpGroupChNumCl(PRTTIMENANOTSDATA pData);
1062RTDECL(uint64_t) RTTimeNanoTSLFenceAsyncUseIdtrLim(PRTTIMENANOTSDATA pData);
1063RTDECL(uint64_t) RTTimeNanoTSLFenceSyncInvarWithDeltaUseApicId(PRTTIMENANOTSDATA pData);
1064RTDECL(uint64_t) RTTimeNanoTSLFenceSyncInvarWithDeltaUseRdtscp(PRTTIMENANOTSDATA pData);
1065RTDECL(uint64_t) RTTimeNanoTSLFenceSyncInvarWithDeltaUseIdtrLim(PRTTIMENANOTSDATA pData);
1066#else
1067RTDECL(uint64_t) RTTimeNanoTSLegacyAsync(PRTTIMENANOTSDATA pData);
1068RTDECL(uint64_t) RTTimeNanoTSLegacySyncInvarWithDelta(PRTTIMENANOTSDATA pData);
1069RTDECL(uint64_t) RTTimeNanoTSLFenceAsync(PRTTIMENANOTSDATA pData);
1070RTDECL(uint64_t) RTTimeNanoTSLFenceSyncInvarWithDelta(PRTTIMENANOTSDATA pData);
1071#endif
1072
1073/** @} */
1074
1075
1076/**
1077 * Gets the current nanosecond timestamp.
1078 *
1079 * This differs from RTTimeNanoTS in that it will use system APIs and not do any
1080 * resolution or performance optimizations.
1081 *
1082 * @returns nanosecond timestamp.
1083 */
1084RTDECL(uint64_t) RTTimeSystemNanoTS(void);
1085
1086/**
1087 * Gets the current millisecond timestamp.
1088 *
1089 * This differs from RTTimeNanoTS in that it will use system APIs and not do any
1090 * resolution or performance optimizations.
1091 *
1092 * @returns millisecond timestamp.
1093 */
1094RTDECL(uint64_t) RTTimeSystemMilliTS(void);
1095
1096/**
1097 * Get the nanosecond timestamp relative to program startup.
1098 *
1099 * @returns Timestamp relative to program startup.
1100 */
1101RTDECL(uint64_t) RTTimeProgramNanoTS(void);
1102
1103/**
1104 * Get the microsecond timestamp relative to program startup.
1105 *
1106 * @returns Timestamp relative to program startup.
1107 */
1108RTDECL(uint64_t) RTTimeProgramMicroTS(void);
1109
1110/**
1111 * Get the millisecond timestamp relative to program startup.
1112 *
1113 * @returns Timestamp relative to program startup.
1114 */
1115RTDECL(uint64_t) RTTimeProgramMilliTS(void);
1116
1117/**
1118 * Get the second timestamp relative to program startup.
1119 *
1120 * @returns Timestamp relative to program startup.
1121 */
1122RTDECL(uint32_t) RTTimeProgramSecTS(void);
1123
1124/**
1125 * Get the RTTimeNanoTS() of when the program started.
1126 *
1127 * @returns Program startup timestamp.
1128 */
1129RTDECL(uint64_t) RTTimeProgramStartNanoTS(void);
1130
1131
1132/**
1133 * Time zone information.
1134 */
1135typedef struct RTTIMEZONEINFO
1136{
1137 /** Unix time zone name (continent/country[/city]|). */
1138 const char *pszUnixName;
1139 /** Windows time zone name. */
1140 const char *pszWindowsName;
1141 /** The length of the unix time zone name. */
1142 uint8_t cchUnixName;
1143 /** The length of the windows time zone name. */
1144 uint8_t cchWindowsName;
1145 /** Two letter country/territory code if applicable, otherwise 'ZZ'. */
1146 char szCountry[3];
1147 /** Two letter windows country/territory code if applicable.
1148 * Empty string if no windows mapping. */
1149 char szWindowsCountry[3];
1150#if 0 /* Add when needed and it's been extracted. */
1151 /** The standard delta in minutes (add to UTC). */
1152 int16_t cMinStdDelta;
1153 /** The daylight saving time delta in minutes (add to UTC). */
1154 int16_t cMinDstDelta;
1155#endif
1156 /** closest matching windows time zone index. */
1157 uint32_t idxWindows;
1158 /** Flags, RTTIMEZONEINFO_F_XXX. */
1159 uint32_t fFlags;
1160} RTTIMEZONEINFO;
1161/** Pointer to time zone info. */
1162typedef RTTIMEZONEINFO const *PCRTTIMEZONEINFO;
1163
1164/** @name RTTIMEZONEINFO_F_XXX - time zone info flags.
1165 * @{ */
1166/** Indicates golden mapping entry for a windows time zone name. */
1167#define RTTIMEZONEINFO_F_GOLDEN RT_BIT_32(0)
1168/** @} */
1169
1170/**
1171 * Looks up static time zone information by unix name.
1172 *
1173 * @returns Pointer to info entry if found, NULL if not.
1174 * @param pszName The unix zone name (TZ).
1175 */
1176RTDECL(PCRTTIMEZONEINFO) RTTimeZoneGetInfoByUnixName(const char *pszName);
1177
1178/**
1179 * Looks up static time zone information by window name.
1180 *
1181 * @returns Pointer to info entry if found, NULL if not.
1182 * @param pszName The windows zone name (reg key).
1183 */
1184RTDECL(PCRTTIMEZONEINFO) RTTimeZoneGetInfoByWindowsName(const char *pszName);
1185
1186/**
1187 * Looks up static time zone information by windows index.
1188 *
1189 * @returns Pointer to info entry if found, NULL if not.
1190 * @param idxZone The windows timezone index.
1191 */
1192RTDECL(PCRTTIMEZONEINFO) RTTimeZoneGetInfoByWindowsIndex(uint32_t idxZone);
1193
1194/**
1195 * Get the current time zone (TZ).
1196 *
1197 * @returns IPRT status code.
1198 * @param pszName Where to return the time zone name.
1199 * @param cbName The size of the name buffer.
1200 */
1201RTDECL(int) RTTimeZoneGetCurrent(char *pszName, size_t cbName);
1202
1203/** @} */
1204
1205RT_C_DECLS_END
1206
1207#endif
1208
Note: See TracBrowser for help on using the repository browser.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette