[PATCH 31/66] tools lib: Guard the strlcpy() header with __GLIBC__

From: Arnaldo Carvalho de Melo
Date: Tue Jul 12 2016 - 18:56:00 EST


From: Arnaldo Carvalho de Melo <acme@xxxxxxxxxx>

Better to whitelist it for libraries that require it (glibc) than
blacklist it with the ones that don't (uclibc, musl libc, etc).

Cc: Adrian Hunter <adrian.hunter@xxxxxxxxx>
Cc: Alexey Brodkin <Alexey.Brodkin@xxxxxxxxxxxx>
Cc: David Ahern <dsahern@xxxxxxxxx>
Cc: Jiri Olsa <jolsa@xxxxxxxxxx>
Cc: Namhyung Kim <namhyung@xxxxxxxxxx>
Cc: Vineet Gupta <vgupta@xxxxxxxxxxxx>
Cc: Wang Nan <wangnan0@xxxxxxxxxx>
Link: http://lkml.kernel.org/n/tip-52ih0m63a2n63tanpy6yj682@xxxxxxxxxxxxxx
Signed-off-by: Arnaldo Carvalho de Melo <acme@xxxxxxxxxx>
---
tools/include/linux/string.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/include/linux/string.h b/tools/include/linux/string.h
index b466d0228b57..b96879477311 100644
--- a/tools/include/linux/string.h
+++ b/tools/include/linux/string.h
@@ -8,7 +8,7 @@ void *memdup(const void *src, size_t len);

int strtobool(const char *s, bool *res);

-#ifndef __UCLIBC__
+#ifdef __GLIBC__
extern size_t strlcpy(char *dest, const char *src, size_t size);
#endif

--
2.7.4