1//===-- Implementation of timespec_get for baremetal ----------------------===//
2//
3// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4// See https://llvm.org/LICENSE.txt for license information.
5// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6//
7//===----------------------------------------------------------------------===//
8
9#include "src/time/timespec_get.h"
10#include "hdr/time_macros.h"
11#include "src/__support/common.h"
12#include "src/__support/macros/config.h"
13
14namespace LIBC_NAMESPACE_DECL {
15
16extern "C" bool __llvm_libc_timespec_get_utc(struct timespec *ts);
17
18LLVM_LIBC_FUNCTION(int, timespec_get, (struct timespec * ts, int base)) {
19 if (base != TIME_UTC)
20 return 0;
21
22 if (!__llvm_libc_timespec_get_utc(ts))
23 return 0;
24 return base;
25}
26
27} // namespace LIBC_NAMESPACE_DECL
28

source code of libc/src/time/baremetal/timespec_get.cpp