diff options
| author | Stefano Babic <[email protected]> | 2021-10-21 13:57:38 +0200 |
|---|---|---|
| committer | Stefano Babic <[email protected]> | 2021-10-21 13:58:13 +0200 |
| commit | 5fac11e6d5ab350429b8c8ddf47d3d3877ca89d1 (patch) | |
| tree | a6fd50ca6f8a79b0647469871fa99223a55d8a96 /include/linux/string.h | |
| parent | e03aa34bdf97f96ad478f7a105482d8231b98aa6 (diff) | |
| parent | 79b8849d4c1e73df2a79a1d5a5f6166d0dd67a12 (diff) | |
Merge branch 'master' of git://git.denx.de/u-boot
Signed-off-by: Stefano Babic <[email protected]>
Diffstat (limited to 'include/linux/string.h')
| -rw-r--r-- | include/linux/string.h | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/include/linux/string.h b/include/linux/string.h index dd255f21633..3169c93796e 100644 --- a/include/linux/string.h +++ b/include/linux/string.h @@ -129,6 +129,19 @@ extern void * memchr(const void *,int,__kernel_size_t); void *memchr_inv(const void *, int, size_t); #endif +/** + * memdup() - allocate a buffer and copy in the contents + * + * Note that this returns a valid pointer even if @len is 0 + * + * @src: data to copy in + * @len: number of bytes to copy + * @return allocated buffer with the copied contents, or NULL if not enough + * memory is available + * + */ +char *memdup(const void *src, size_t len); + unsigned long ustrtoul(const char *cp, char **endp, unsigned int base); unsigned long long ustrtoull(const char *cp, char **endp, unsigned int base); |
