xref: /netbsd-src/external/bsd/ntp/dist/libntp/lib/isc/win32/stdtime.c (revision eabc0478de71e4e011a5b4e0392741e01d491794)
1*eabc0478Schristos /*	$NetBSD: stdtime.c,v 1.2 2024/08/18 20:47:16 christos Exp $	*/
2897be3a4Schristos 
3897be3a4Schristos /*
4897be3a4Schristos  * Copyright (C) 2004, 2007  Internet Systems Consortium, Inc. ("ISC")
5897be3a4Schristos  * Copyright (C) 1999-2001  Internet Software Consortium.
6897be3a4Schristos  *
7897be3a4Schristos  * Permission to use, copy, modify, and/or distribute this software for any
8897be3a4Schristos  * purpose with or without fee is hereby granted, provided that the above
9897be3a4Schristos  * copyright notice and this permission notice appear in all copies.
10897be3a4Schristos  *
11897be3a4Schristos  * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
12897be3a4Schristos  * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
13897be3a4Schristos  * AND FITNESS.  IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
14897be3a4Schristos  * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
15897be3a4Schristos  * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
16897be3a4Schristos  * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
17897be3a4Schristos  * PERFORMANCE OF THIS SOFTWARE.
18897be3a4Schristos  */
19897be3a4Schristos 
20897be3a4Schristos /* Id: stdtime.c,v 1.12 2007/06/19 23:47:19 tbox Exp  */
21897be3a4Schristos 
22897be3a4Schristos #include <config.h>
23897be3a4Schristos 
24897be3a4Schristos #include <time.h>
25897be3a4Schristos 
26897be3a4Schristos #include <isc/assertions.h>
27897be3a4Schristos #include <isc/stdtime.h>
28897be3a4Schristos #include <isc/util.h>
29897be3a4Schristos 
30897be3a4Schristos void
31897be3a4Schristos isc_stdtime_get(isc_stdtime_t *t) {
32897be3a4Schristos 	/*
33897be3a4Schristos 	 * Set 't' to the number of seconds past 00:00:00 UTC, January 1, 1970.
34897be3a4Schristos 	 */
35897be3a4Schristos 
36897be3a4Schristos 	REQUIRE(t != NULL);
37897be3a4Schristos 
38897be3a4Schristos 	(void)time((time_t *)t);
39897be3a4Schristos }
40