diff options
| author | Richard Qin <richard.qin.x@gmail.com> | 2026-07-11 22:48:30 +0800 |
|---|---|---|
| committer | Richard Qin <richard.qin.x@gmail.com> | 2026-07-11 22:48:30 +0800 |
| commit | 3ad39e9878310e5317ee73c9b353c1e2c1c5c4ee (patch) | |
| tree | 4bd5a49ef60ad1e371c0984cd46838368c5ef83a /lib/ktl/include/time.h | |
| parent | 48ef95c24e9ac3d11200b61af617a01b10b507d1 (diff) | |
| download | lume-3ad39e9878310e5317ee73c9b353c1e2c1c5c4ee.tar.gz lume-3ad39e9878310e5317ee73c9b353c1e2c1c5c4ee.tar.xz | |
lib: establish Zircon libc++ and KTL foundation
Diffstat (limited to 'lib/ktl/include/time.h')
| -rw-r--r-- | lib/ktl/include/time.h | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/lib/ktl/include/time.h b/lib/ktl/include/time.h new file mode 100644 index 0000000..138801f --- /dev/null +++ b/lib/ktl/include/time.h @@ -0,0 +1,39 @@ +// Copyright 2020 The Fuchsia Authors +// +// Use of this source code is governed by a MIT-style +// license that can be found in the LICENSE file or at +// https://opensource.org/licenses/MIT + +#ifndef ZIRCON_KERNEL_LIB_KTL_INCLUDE_TIME_H_ +#define ZIRCON_KERNEL_LIB_KTL_INCLUDE_TIME_H_ + +#include <stddef.h> + +// <zircon/time.h> uses these when __has_include(<time.h>). +typedef long int time_t; +struct timespec { + time_t tv_sec; + long int tv_nsec; +}; + +// The kernel doesn't want this file but some libc++ headers we need +// wind up including it and they need these declarations. + +#ifdef __cplusplus + +using clock_t = long int; +struct tm {}; +char* asctime(tm*) noexcept; +clock_t clock() noexcept; +char* ctime(const time_t*) noexcept; +double difftime(time_t, time_t) noexcept; +tm* gmtime(const time_t*) noexcept; +tm* localtime(const time_t*) noexcept; +time_t mktime(tm*) noexcept; +size_t strftime(char*, size_t, const char*, const tm*) noexcept; +time_t time(time_t*) noexcept; +int timespec_get(timespec* ts, int) noexcept; + +#endif // __cplusplus + +#endif // ZIRCON_KERNEL_LIB_KTL_INCLUDE_TIME_H_ |
