1/*-
2 * See the file LICENSE for redistribution information.
3 *
4 * Copyright (c) 2006,2008 Oracle.  All rights reserved.
5 *
6 * $Id: os_clock.c,v 1.10 2008/03/13 15:36:21 mbrey Exp $
7 */
8
9#include "db_config.h"
10
11#include "db_int.h"
12
13/*
14 * __os_gettime --
15 *	Return the current time-of-day clock in seconds and nanoseconds.
16 */
17void
18__os_gettime(env, tp, monotonic)
19	ENV *env;
20	db_timespec *tp;
21	int monotonic;
22{
23	/*
24	 * Berkeley DB uses POSIX time values internally; convert a BREW time
25	 * value into a POSIX time value.
26	 */
27	 tp->tv_sec =
28#ifdef HAVE_BREW_SDK2
29	    (time_t)GETTIMESECONDS() + BREW_EPOCH_OFFSET;
30#else
31	    (time_t)GETUTCSECONDS() + BREW_EPOCH_OFFSET;
32#endif
33	tp->tv_nsec = 0;
34}
35