summaryrefslogtreecommitdiff
path: root/include/linux/string.h
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2020-02-03 07:36:01 -0700
committerSimon Glass <sjg@chromium.org>2020-02-05 19:33:46 -0700
commitf72bdc60b230f5e5d77eaad0b2defe07a46c02a9 (patch)
tree7c869c77d50814ef38914197dd203c4b6db85b2a /include/linux/string.h
parent1ea1c7d80f9dd7a4827cddf25fba71d0034510e4 (diff)
sandbox: Rename strdup() functions
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>
Diffstat (limited to 'include/linux/string.h')
-rw-r--r--include/linux/string.h5
1 files changed, 5 insertions, 0 deletions
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);
#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);