Zephyr API Documentation  2.7.0-rc2
A Scalable Open Source RTOS
time.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 2017 Intel Corporation
3 * Copyright (c) 2019 Peter Bigot Consulting, LLC
4 *
5 * SPDX-License-Identifier: Apache-2.0
6 */
7
8#ifndef ZEPHYR_LIB_LIBC_MINIMAL_INCLUDE_TIME_H_
9#define ZEPHYR_LIB_LIBC_MINIMAL_INCLUDE_TIME_H_
10
11#include <stdint.h>
12#include <sys/_types.h>
13#include <bits/restrict.h>
14#include <sys/_timespec.h>
15
16/* Minimal time.h to fulfill the requirements of certain libraries
17 * like mbedTLS and to support time APIs.
18 */
19
20#ifdef __cplusplus
21extern "C" {
22#endif
23
24struct tm {
25 int tm_sec;
26 int tm_min;
29 int tm_mon;
34};
35
36#if !defined(__time_t_defined)
37#define __time_t_defined
38typedef _TIME_T_ time_t;
39#endif
40
41#if !defined(__suseconds_t_defined)
42#define __suseconds_t_defined
43typedef _SUSECONDS_T_ suseconds_t;
44#endif
45
46/*
47 * Conversion between civil time and UNIX time. The companion
48 * localtime() and inverse mktime() are not provided here since they
49 * require access to time zone information.
50 */
51struct tm *gmtime(const time_t *timep);
52struct tm *gmtime_r(const time_t *_MLIBC_RESTRICT timep,
53 struct tm *_MLIBC_RESTRICT result);
54
56
57#ifdef __cplusplus
58}
59#endif
60
61#endif /* ZEPHYR_LIB_LIBC_MINIMAL_INCLUDE_STDIO_H_ */
_TIME_T_ time_t
Definition: _timespec.h:14
struct tm * gmtime(const time_t *timep)
struct tm * gmtime_r(const time_t *_MLIBC_RESTRICT timep, struct tm *_MLIBC_RESTRICT result)
time_t time(time_t *tloc)
_TIME_T_ time_t
Definition: time.h:38
_SUSECONDS_T_ suseconds_t
Definition: time.h:43
_MLIBC_RESTRICT definition
Definition: errno.c:36
Definition: time.h:24
int tm_mon
Definition: time.h:29
int tm_year
Definition: time.h:30
int tm_hour
Definition: time.h:27
int tm_sec
Definition: time.h:25
int tm_isdst
Definition: time.h:33
int tm_yday
Definition: time.h:32
int tm_mday
Definition: time.h:28
int tm_min
Definition: time.h:26
int tm_wday
Definition: time.h:31