Skip to content

Commit c8c894b

Browse files
tagunilfabiobaltieri
authored andcommitted
lib: libc: arcmwdt: add a declaration for the strnlen function
ARC MWDT C library does not have an implementation of the strnlen function, so we have a wrapper over standard-compliant strnlen_s. However, there is no declaration of the wrapper, so add one. Signed-off-by: Ilya Tagunov <[email protected]>
1 parent 6e2001b commit c8c894b

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

lib/libc/arcmwdt/include/string.h

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
/*
2+
* Copyright (c) 2025 Synopsys
3+
*
4+
* SPDX-License-Identifier: Apache-2.0
5+
*/
6+
7+
#ifndef LIB_LIBC_ARCMWDT_INCLUDE_STRING_H_
8+
#define LIB_LIBC_ARCMWDT_INCLUDE_STRING_H_
9+
10+
#include_next <string.h>
11+
12+
#ifdef __cplusplus
13+
extern "C" {
14+
#endif
15+
16+
extern size_t strnlen(const char *s, size_t maxlen);
17+
18+
#ifdef __cplusplus
19+
}
20+
#endif
21+
22+
#endif /* LIB_LIBC_ARCMWDT_INCLUDE_STRING_H_ */

0 commit comments

Comments
 (0)