GNU Linux-libre 4.9.292-gnu1
[releases.git] / tools / include / linux / string.h
1 #ifndef _TOOLS_LINUX_STRING_H_
2 #define _TOOLS_LINUX_STRING_H_
3
4
5 #include <linux/types.h>        /* for size_t */
6
7 void *memdup(const void *src, size_t len);
8
9 int strtobool(const char *s, bool *res);
10
11 /*
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__)
16 // pragma diagnostic was introduced in gcc 4.6
17 #if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6)
18 #pragma GCC diagnostic push
19 #pragma GCC diagnostic ignored "-Wredundant-decls"
20 #endif
21 extern size_t strlcpy(char *dest, const char *src, size_t size);
22 #if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6)
23 #pragma GCC diagnostic pop
24 #endif
25 #endif
26
27 char *str_error_r(int errnum, char *buf, size_t buflen);
28
29 #endif /* _LINUX_STRING_H_ */