blob: f436d2420a18575095e66b7bfbf15b0abbe83fe8 [file] [log] [blame]
Arnaldo Carvalho de Melo4ddd3272015-11-16 11:36:29 -03001#ifndef _TOOLS_LINUX_STRING_H_
2#define _TOOLS_LINUX_STRING_H_
3
4
5#include <linux/types.h> /* for size_t */
6
7void *memdup(const void *src, size_t len);
8
Wang Nan7d85c432015-11-16 11:42:05 -03009int strtobool(const char *s, bool *res);
10
Vineet Gupta0215d592016-08-18 09:28:23 -070011/*
12 * glibc based builds needs the extern while uClibc doesn't.
13 * However uClibc headers also define __GLIBC__ hence the hack below
14 */
15#if defined(__GLIBC__) && !defined(__UCLIBC__)
Josh Poimboeufce990912015-12-15 09:39:33 -060016extern size_t strlcpy(char *dest, const char *src, size_t size);
17#endif
18
Arnaldo Carvalho de Meloc8b5f2c2016-07-06 11:56:20 -030019char *str_error_r(int errnum, char *buf, size_t buflen);
20
Arnaldo Carvalho de Melo4ddd3272015-11-16 11:36:29 -030021#endif /* _LINUX_STRING_H_ */