Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:argv_split - split a string at whitespace, returning an argv*@gfp: the GFP mask used to allocate memory*@str: the string to be split*@argcp: returned argument count* Returns an array of pointers to strings which are split out from*@str

Proto:char **argv_split(gfp_t gfp, const char *str, int *argcp)

Type:char

Parameter:

TypeParameterName
gfp_tgfp
const char *str
int *argcp
67  argv_str = kstrndup(str, Maximum allocatable size - 1, gfp)
68  If Not argv_str Then Return NULL
71  argc = count_argc(argv_str)
72  argv = kmalloc_array - allocate memory for an array.*@n: number of elements.*@size: element size.*@flags: the type of memory to allocate (see kmalloc).
73  If Not argv Then
74  kfree(argv_str)
75  Return NULL
78  argv = argv_str
79  argv_ret = ++argv
80  When argv_str cycle
82  was_space = true
83  argv_str = 0
84  Else if was_space Then
85  was_space = false
86  argv++ = argv_str
89  * argv = NULL
91  If argcp Then argcp = argc
93  Return argv_ret
Caller
NameDescribe
run_cmd
trace_run_command