Http://hi.baidu.com/serial_story/blog/item/fcec44ec707dd5dd2e2e21ed.html
[Arrangement] functions such as atoi and ITOA in Linux Kernel
For common applications, You can include the header file stdlib. H, stdio. H, String. H, and so on, and then call the required functions such as ITOA () and atoi,
But for Linux kernel, functions in those C libraries cannot be used.
The Linux kernel has the following implementations:
ForAtoi()Simple_strtol(),Simple_strtoul() And other functions;
ForITOA(), UseSnprintf().
For other related functions, go to/lib/vsprintf. C.
For example:
Simple_strtoul, simple_strtol, simple_strtoull, strict_strtoul, strict_strtol, strict_strtoull, strict_strtoll, vsnprintf, vscnprintf
In addition, common character-related processing functions are in/lib/string. C:
Strnicmp, strcasecmp, comment, strcpy, comment, strlcpy, strcat, strncat, strlcat, strcmp, strncmp, strchr, comment, strip, strlen, strsep, sysfs_streq
And memory-related operation functions:
Memset, memcpy, memmove, memcmp, memscan, strstr, memchr
[Reference]
1. Re: ITOA and atoi functions in kernel space
Http://mail.nl.linux.org/kernelnewbies/2005-07/msg00417.html
2.Can stdlib. h and stdio. H be referenced in the kernel?
Http://linux.chinaunix.net/bbs/viewthread.php? Tid = 910745