From patchwork Sun Jan 12 19:06:06 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 239506 List-Id: U-Boot discussion From: sjg at chromium.org (Simon Glass) Date: Sun, 12 Jan 2020 12:06:06 -0700 Subject: [PATCH 15/33] sandbox: Rename strdup() functions In-Reply-To: <20200112190624.79077-1-sjg@chromium.org> References: <20200112190624.79077-1-sjg@chromium.org> Message-ID: <20200112120216.15.Ia17e6b1cf15e09c3ff420ce4023dfbe236e72658@changeid> 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 --- 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); #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);