]> Git Repo - linux.git/blob - tools/include/nolibc/time.h
Merge tag 'riscv-for-linus-5.19-mw0' of git://git.kernel.org/pub/scm/linux/kernel...
[linux.git] / tools / include / nolibc / time.h
1 /* SPDX-License-Identifier: LGPL-2.1 OR MIT */
2 /*
3  * time function definitions for NOLIBC
4  * Copyright (C) 2017-2022 Willy Tarreau <[email protected]>
5  */
6
7 #ifndef _NOLIBC_TIME_H
8 #define _NOLIBC_TIME_H
9
10 #include "std.h"
11 #include "arch.h"
12 #include "types.h"
13 #include "sys.h"
14
15 static __attribute__((unused))
16 time_t time(time_t *tptr)
17 {
18         struct timeval tv;
19
20         /* note, cannot fail here */
21         sys_gettimeofday(&tv, NULL);
22
23         if (tptr)
24                 *tptr = tv.tv_sec;
25         return tv.tv_sec;
26 }
27
28 #endif /* _NOLIBC_TIME_H */
This page took 0.03593 seconds and 4 git commands to generate.