diff options
author | Tom Rini <trini@konsulko.com> | 2021-10-08 16:02:55 -0400 |
---|---|---|
committer | Tom Rini <trini@konsulko.com> | 2021-10-08 16:02:55 -0400 |
commit | 94e922c76a0e1fcdead3359e340f53fd0709a963 (patch) | |
tree | 667372191c3a70cd9343180c8d7f6273afbb9ab9 /include/linux/string.h | |
parent | 0caf37e973015255a3c5b9439ddb8c6aef1b5001 (diff) | |
parent | 4cb35b7a1fdf060a0839b71f6dbf8d08b1ae62e0 (diff) |
Merge branch '2021-10-08-image-cleanups'
- A large number of image file and tooling related cleanups
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 dd255f2163..3169c93796 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); |