During device driver development, we may need to concatenate a string or to compute its length or just copy or move a memory region (or a string). To do these common operations in the user space, we can use several functions, such as strcat(), strlen(), memcpy() (or strcpy()), and so on, and Linux offers us similarly named functions, which, of course, are safely usable in the kernel. (Note that kernel code cannot be linked against userspace glibc libraries.)
In this recipe, we will see how to use some kernel helpers in order to manage strings within the kernel.