]>
git.proxmox.com Git - wasi-libc.git/blob - libc-bottom-half/cloudlibc/src/libc/sys/time/gettimeofday.c
1 // Copyright (c) 2015-2016 Nuxi, https://nuxi.nl/
3 // SPDX-License-Identifier: BSD-2-Clause
5 #include <common/time.h>
11 #ifdef __wasilibc_unmodified_upstream
12 int gettimeofday(struct timeval
*restrict tp
, ...) {
14 int gettimeofday(struct timeval
*restrict tp
, void *tz
) {
16 __wasi_timestamp_t ts
= 0;
17 (void)__wasi_clock_time_get(__WASI_CLOCK_REALTIME
, 1000, &ts
);
18 *tp
= timestamp_to_timeval(ts
);