[PATCH v2 15/32] sandbox: Rename strdup() functions

Simon Glass sjg at chromium.org
Mon Feb 3 15:36:01 CET 2020

These functions include calls to a memory-allocation routine and so need
to use the system routine when called from a library.

To preserve access to these functions for libraries that need it, such as
SDL, rename these functions within U-Boot.

Signed-off-by: Simon Glass <sjg at chromium.org>

Changes in v2: None

 include/linux/string.h | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/include/linux/string.h b/include/linux/string.h
index bb1d5ab07e..d67998e5c4 100644
--- a/include/linux/string.h
+++ b/include/linux/string.h
@@ -91,6 +91,11 @@ extern __kernel_size_t strnlen(const char *,__kernel_size_t);
 size_t strcspn(const char *s, const char *reject);
+# define strdup		sandbox_strdup
+# define strndup		sandbox_strndup
 extern char * strdup(const char *);
 extern char * strndup(const char *, size_t);

More information about the U-Boot mailing list