#include <linux/slab.h>#include <linux/string.h>#include <linux/module.h>/** * kzalloc - allocate memory. The memory is set to zero. * @size: how many bytes of memory are required. * @flags: the type of memory to allocate. */void*kzalloc(size_tsize,gfp_tflags){void*ret=kmalloc(size,flags);if(ret)memset(ret,0,size);returnret;}EXPORT_SYMBOL(kzalloc);/* * kstrdup - allocate space for and copy an existing string * * @s: the string to duplicate * @gfp: the GFP mask used in the kmalloc() call when allocating memory */char*kstrdup(constchar*s,gfp_tgfp){size_tlen;char*buf;if(!s)returnNULL;len=strlen(s)+1;buf=kmalloc(len,gfp);if(buf)memcpy(buf,s,len);returnbuf;}EXPORT_SYMBOL(kstrdup);