1From db3a3714be07c8ab51b9ae7b035e4afe9f39c645 Mon Sep 17 00:00:00 2001 2From: Khem Raj <raj.khem@gmail.com> 3Date: Wed, 7 Sep 2022 13:20:22 -0700 4Subject: [PATCH] memory.h: Always define strlcpy for glibc based systems 5 6android-config.h file includes on compiler cmdline sets HAVE_STRLCPY 7unconditionally, since bionic supports it, its no big deal on android 8and also no problem when using musl since implementation exists for musl 9too, but glibc does not provide this. So either we include libbsd or use 10the implementation provided by android-tools here. We are currently 11using the in tree implementation for systems which do not provide it 12 13Upstream-Status: Pending 14 15Signed-off-by: Khem Raj <raj.khem@gmail.com> 16--- 17 include/cutils/memory.h | 2 +- 18 1 file changed, 1 insertion(+), 1 deletion(-) 19 20diff --git a/include/cutils/memory.h b/include/cutils/memory.h 21index e725cdd032..9e99353c58 100644 22--- a/include/cutils/memory.h 23+++ b/include/cutils/memory.h 24@@ -30,7 +30,7 @@ void android_memset16(uint16_t* dst, uint16_t value, size_t size); 25 /* size is given in bytes and must be multiple of 4 */ 26 void android_memset32(uint32_t* dst, uint32_t value, size_t size); 27 28-#if !HAVE_STRLCPY 29+#if !HAVE_STRLCPY || defined(__GLIBC__) 30 /* Declaration of strlcpy() for platforms that don't already have it. */ 31 size_t strlcpy(char *dst, const char *src, size_t size); 32 #endif 33-- 342.37.3 35 36