[libc-commits] [libc] [libc] Implement `timespec_get` (PR #116102)

Nick Desaulniers via libc-commits libc-commits at lists.llvm.org
Thu Nov 14 08:46:29 PST 2024


================
@@ -0,0 +1,23 @@
+//===---------- Baremetal implementation of time utils ----------*- C++ -*-===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+#include "time.h"
+
+#include "src/__support/macros/config.h"
+
+namespace LIBC_NAMESPACE_DECL {
+namespace internal {
+
+extern "C" int __llvm_libc_timespec_get_utc(struct timespec *ts);
+
+bool timespec_get_utc(struct timespec *ts) {
+  return __llvm_libc_timespec_get_utc(ts);
----------------
nickdesaulniers wrote:

Can you either start in a new PR, or file a bug about documenting the list of hooks necessary for baremetal targets to implement?

https://github.com/llvm/llvm-project/pull/116102


More information about the libc-commits mailing list