Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:lib\kasprintf.c Create Date:2022-07-28 06:20:14
Last Modify:2020-03-12 14:18:49 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name:If fmt contains no % (or is exactly %s), use kstrdup_const. If fmt* (or the sole vararg) points to rodata, we will then save a memory* allocation and string copy. In any case, the return value should be* freed using kfree_const().

Proto:const char *kvasprintf_const(gfp_t gfp, const char *fmt, va_list ap)

Type:char

Parameter:

TypeParameterName
gfp_tgfp
const char *fmt
va_listap
45  If Not strchr(fmt, '%') Then Return kstrdup_const - conditionally duplicate an existing const string*@s: the string to duplicate*@gfp: the GFP mask used in the kmalloc() call when allocating memory* Note: Strings allocated by kstrdup_const should be freed by kfree_const.
47  If Not strcmp(fmt, "%s") Then Return kstrdup_const - conditionally duplicate an existing const string*@s: the string to duplicate*@gfp: the GFP mask used in the kmalloc() call when allocating memory* Note: Strings allocated by kstrdup_const should be freed by kfree_const.
49  Return Simplified asprintf.