sandbox: Rename strdup() functions
authorSimon Glass <sjg@chromium.org>
Mon, 3 Feb 2020 14:36:01 +0000 (07:36 -0700)
committerSimon Glass <sjg@chromium.org>
Thu, 6 Feb 2020 02:33:46 +0000 (19:33 -0700)
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@chromium.org>
include/linux/string.h

index bb1d5ab07e3fef680105ce19e84220cd08b49fc7..d67998e5c41a40d8a94f3de0f1474a19d173bf0f 100644 (file)
@@ -91,6 +91,11 @@ extern __kernel_size_t strnlen(const char *,__kernel_size_t);
 size_t strcspn(const char *s, const char *reject);
 #endif
 
+#ifdef CONFIG_SANDBOX
+# define strdup                sandbox_strdup
+# define strndup               sandbox_strndup
+#endif
+
 #ifndef __HAVE_ARCH_STRDUP
 extern char * strdup(const char *);
 extern char * strndup(const char *, size_t);