26 lines · cpp
1//===-- Linux implementation of localtime_r function ----------------------===//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-exception6//7//===----------------------------------------------------------------------===//8 9#include "src/time/localtime_r.h"10#include "hdr/types/struct_tm.h"11#include "hdr/types/time_t.h"12#include "src/__support/macros/null_check.h"13#include "src/time/time_utils.h"14 15namespace LIBC_NAMESPACE_DECL {16 17LLVM_LIBC_FUNCTION(struct tm *, localtime_r,18 (const time_t *timer, struct tm *buf)) {19 LIBC_CRASH_ON_NULLPTR(timer);20 LIBC_CRASH_ON_NULLPTR(buf);21 22 return time_utils::localtime_internal(timer, buf);23}24 25} // namespace LIBC_NAMESPACE_DECL26