Merge tag 'trace-printf-v6.13' of git://git.kernel.org/pub/scm/linux/kernel/git/trace...
[drm/drm-misc.git] / tools / include / nolibc / time.h
blob84655361b9ad2ce141f9af2759f2b128ae8a83a3
1 /* SPDX-License-Identifier: LGPL-2.1 OR MIT */
2 /*
3 * time function definitions for NOLIBC
4 * Copyright (C) 2017-2022 Willy Tarreau <w@1wt.eu>
5 */
7 #ifndef _NOLIBC_TIME_H
8 #define _NOLIBC_TIME_H
10 #include "std.h"
11 #include "arch.h"
12 #include "types.h"
13 #include "sys.h"
15 static __attribute__((unused))
16 time_t time(time_t *tptr)
18 struct timeval tv;
20 /* note, cannot fail here */
21 sys_gettimeofday(&tv, NULL);
23 if (tptr)
24 *tptr = tv.tv_sec;
25 return tv.tv_sec;
28 /* make sure to include all global symbols */
29 #include "nolibc.h"
31 #endif /* _NOLIBC_TIME_H */