Skip to content

Commit c8511c1

Browse files
tagunilnashif
authored andcommitted
lib: libc: arcmwdt: add declarations for reentrant time functions
ARC MWDT library does not contain implementations for the reentrant POSIX time functions, so common Zephyr implementations end up being used instead. However, there are no declarations, so we just add them here, unguarded, until a better place is found. Signed-off-by: Ilya Tagunov <[email protected]>
1 parent de18565 commit c8511c1

File tree

1 file changed

+25
-0
lines changed
  • lib/libc/arcmwdt/include

1 file changed

+25
-0
lines changed

lib/libc/arcmwdt/include/time.h

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
/*
2+
* Copyright (c) 2024 Synopsys
3+
*
4+
* SPDX-License-Identifier: Apache-2.0
5+
*/
6+
7+
#ifndef LIB_LIBC_ARCMWDT_INCLUDE_TIME_H_
8+
#define LIB_LIBC_ARCMWDT_INCLUDE_TIME_H_
9+
10+
#include_next <time.h>
11+
12+
#ifdef __cplusplus
13+
extern "C" {
14+
#endif
15+
16+
extern char *asctime_r(const struct tm *tp, char *buf);
17+
extern char *ctime_r(const time_t *clock, char *buf);
18+
extern struct tm *gmtime_r(const time_t *timep, struct tm *result);
19+
extern struct tm *localtime_r(const time_t *timer, struct tm *result);
20+
21+
#ifdef __cplusplus
22+
}
23+
#endif
24+
25+
#endif /* LIB_LIBC_ARCMWDT_INCLUDE_TIME_H_ */

0 commit comments

Comments
 (0)