函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:lib\string_helpers.c Create Date:2022-07-27 07:23:10
Last Modify:2020-03-12 14:18:49 Copyright©Brick
首页 函数Tree
注解内核,赢得工具下载SCCTEnglish

函数名称:Return an allocated string that has been escaped of special characters* and double quotes, making it safe to log in quotes.

函数原型:char *kstrdup_quotable(const char *src, gfp_t gfp)

返回类型:char

参数:

类型参数名称
const char *src
gfp_tgfp
573  flags等于ESCAPE_HEX
574  esc[]等于"\f\n\r\t\v\a\e\\\""
576  如果非src则返回:NULL
578  slen等于strlen(src)
580  dlen等于string_escape_mem - quote characters in the given memory buffer*@src: source buffer (unescaped)*@isz: source buffer size*@dst: destination buffer (escaped)*@osz: destination buffer size*@flags: combination of the flags*@only: NULL-terminated string
581  dst等于kmalloc(dlen + 1, gfp)
582  如果非dst则返回:NULL
585  WARN_ON(string_escape_mem - quote characters in the given memory buffer*@src: source buffer (unescaped)*@isz: source buffer size*@dst: destination buffer (escaped)*@osz: destination buffer size*@flags: combination of the flags*@only: NULL-terminated string != dlen)
586  dst[dlen]等于'\0'
588  返回:dst
调用者
名称描述
kstrdup_quotable_cmdlineReturns allocated NULL-terminated string containing process* command line, with inter-argument NULLs replaced with spaces,* and other special characters escaped.
kstrdup_quotable_fileReturns allocated NULL-terminated string containing pathname,* with special characters escaped, able to be safely logged. If* there is an error, the leading character will be "<".