1 #include <linux/slab.h>
2 #include <linux/string.h>
3 #include <linux/module.h>
6 * kzalloc - allocate memory. The memory is set to zero.
7 * @size: how many bytes of memory are required.
8 * @flags: the type of memory to allocate.
10 void *kzalloc(size_t size, gfp_t flags)
12 void *ret = kmalloc(size, flags);
17 EXPORT_SYMBOL(kzalloc);
20 * kstrdup - allocate space for and copy an existing string
22 * @s: the string to duplicate
23 * @gfp: the GFP mask used in the kmalloc() call when allocating memory
25 char *kstrdup(const char *s, gfp_t gfp)
34 buf = kmalloc(len, gfp);
39 EXPORT_SYMBOL(kstrdup);