You've already forked linux-apfs
mirror of
https://github.com/linux-apfs/linux-apfs.git
synced 2026-05-01 15:00:59 -07:00
20 lines
297 B
C
20 lines
297 B
C
|
|
#include <stdlib.h>
|
||
|
|
#include <string.h>
|
||
|
|
#include <linux/string.h>
|
||
|
|
|
||
|
|
/**
|
||
|
|
* memdup - duplicate region of memory
|
||
|
|
*
|
||
|
|
* @src: memory region to duplicate
|
||
|
|
* @len: memory region length
|
||
|
|
*/
|
||
|
|
void *memdup(const void *src, size_t len)
|
||
|
|
{
|
||
|
|
void *p = malloc(len);
|
||
|
|
|
||
|
|
if (p)
|
||
|
|
memcpy(p, src, len);
|
||
|
|
|
||
|
|
return p;
|
||
|
|
}
|