Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:lib\vsprintf.c Create Date:2022-07-28 06:12:26
Last Modify:2022-05-21 09:47:42 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name:vsnprintf - Format a string and place it in a buffer*@buf: The buffer to place the result into*@size: The size of the buffer, including the trailing null space*@fmt: The format string to use*@args: Arguments for the format string* This function generally

Proto:int vsnprintf(char *buf, size_t size, const char *fmt, va_list args)

Type:int

Parameter:

TypeParameterName
char *buf
size_tsize
const char *fmt
va_listargs
2508  struct printf_spec spec = {0}
2512  If WARN_ON_ONCE(size > INT_MAX) Then Return 0
2515  str = buf
2516  end = buf + size
2519  If end < buf Then
2520  end = ((void * ) - 1)
2521  size = end - buf
2524  When fmt cycle
2525  old_fmt = fmt
2526  read = Helper function to decode printf style format
2528  fmt += read
2532  copy = read
2533  If str < end Then
2534  If copy > end - str Then copy = end - str
2538  str += read
2539  Break
2542  Case format_type enum == FORMAT_TYPE_WIDTH
2543  set_field_width( & spec, va_arg(args, int))
2544  Break
2546  Case format_type enum == FORMAT_TYPE_PRECISION
2547  set_precision( & spec, va_arg(args, int))
2548  Break
2550  Case format_type enum == FORMAT_TYPE_CHAR
2553  If Not ( flags to number() & left justified ) Then
2554  When -- width of output field > 0 cycle
2555  If str < end Then str = ' '
2557  ++str
2561  c = va_arg(args, int)
2562  If str < end Then str = c
2564  ++str
2565  When -- width of output field > 0 cycle
2566  If str < end Then str = ' '
2568  ++str
2570  Break
2573  Case format_type enum == FORMAT_TYPE_STR
2574  str = string(str, end, va_arg(args, char * ), spec)
2575  Break
2577  Case format_type enum == FORMAT_TYPE_PTR
2578  str = Show a '%p' thing. A kernel extension is that the '%p' is followed* by an extra set of alphanumeric characters that are extended format* specifiers.* Please update scripts/checkpatch.pl when adding/removing conversion* characters
2580  When isalnum( * fmt) cycle
2581  fmt++
2582  Break
2584  Case format_type enum == FORMAT_TYPE_PERCENT_CHAR
2585  If str < end Then str = '%'
2587  ++str
2588  Break
2590  Case format_type enum == FORMAT_TYPE_INVALID
2599  Go to out
2601  Default
2604  num = va_arg(args, longlong)
2605  Break
2607  num = va_arg(args, unsignedlong)
2608  Break
2610  num = va_arg(args, long)
2611  Break
2615  Else num = va_arg(args, size_t)
2617  Break
2619  num = va_arg(args, ptrdiff_t)
2620  Break
2622  num = va_arg(args, int)
2623  Break
2625  num = va_arg(args, int)
2626  Break
2628  num = va_arg(args, int)
2629  Break
2631  num = va_arg(args, int)
2632  Break
2634  num = va_arg(args, int)
2635  Break
2636  Default
2637  num = va_arg(args, unsignedint)
2640  str = number(str, end, num, spec)
2644  out :
2645  If size > 0 Then
2646  If str < end Then str = '\0'
2648  Else end[ - 1] = '\0'
2653  Return str - buf
Caller
NameDescribe
va_format
vscnprintfvscnprintf - Format a string and place it in a buffer*@buf: The buffer to place the result into*@size: The size of the buffer, including the trailing null space*@fmt: The format string to use*@args: Arguments for the format string* The return value is the
snprintfsnprintf - Format a string and place it in a buffer*@buf: The buffer to place the result into*@size: The size of the buffer, including the trailing null space*@fmt: The format string to use*@
vsprintfvsprintf - Format a string and place it in a buffer*@buf: The buffer to place the result into*@fmt: The format string to use*@args: Arguments for the format string* The function returns the number of characters written* into @buf
sprintfsprintf - Format a string and place it in a buffer*@buf: The buffer to place the result into*@fmt: The format string to use*@...: Arguments for the format string* The function returns the number of characters written* into @buf
add_uevent_varadd_uevent_var - add key value string to the environment buffer*@env: environment buffer structure*@format: printf format for the key=value pair* Returns 0 if environment variable was added successfully or -ENOMEM* if no space was available.
seq_buf_vprintfseq_buf_vprintf - sequence printing of information.*@s: seq_buf descriptor*@fmt: printf format string*@args: va_list of arguments from a printf() type function* Writes a vnprintf() format into the sequencce buffer.* Returns zero on success, -1 on overflow.
dump_stack_set_arch_descdump_stack_set_arch_desc - set arch-specific str to show with task dumps*@fmt: printf-style format string*@...: arguments for the format string* The configured string will be printed right after utsname during task* dumps
kvasprintfSimplified asprintf.
do_test
string_stream_vadd
set_worker_descset_worker_desc - set description for the current work item*@fmt: printf-style format string*@...: arguments for the format string* This function can be called by a running work function to describe what* the work item is about
__kthread_create_on_node
__request_module__request_module - try to load a kernel module*@wait: wait (or not) for the operation to complete*@fmt: printf style format string for the name of the module*@...: arguments as specified in the format string
audit_log_vformatFormat an audit message into the audit buffer. If there isn't enough* room in the audit buffer, more room will be allocated and vsnprint* will be called a second time. Currently, we assume that a printk
vkdb_printf
tomoyo_write_logmoyo_write_log - Write an audit log.*@r: Pointer to "struct tomoyo_request_info".*@fmt: The printf()'s format string, followed by parameters.* Returns nothing.
tomoyo_addprintfmoyo_addprintf - strncat()-like-snprintf().*@buffer: Buffer to write to. Must be '\0'-terminated.*@len: Size of @buffer.*@fmt: The printf()'s format string, followed by parameters.* Returns nothing.
tomoyo_io_printfmoyo_io_printf - printf() to "struct tomoyo_io_buffer" structure.*@head: Pointer to "struct tomoyo_io_buffer".*@fmt: The printf()'s format string, followed by parameters.
tomoyo_supervisormoyo_supervisor - Ask for the supervisor's decision
dynamic_dnameHelper function for dentry_operations.d_dname() members
cn_vprintf