Skip to content
Commit a08c5356 authored by Linus Torvalds's avatar Linus Torvalds
Browse files

lib: add generic strnlen_user() function



This adds a new generic optimized strnlen_user() function that uses the
<asm/word-at-a-time.h> infrastructure to portably do efficient string
handling.

In many ways, strnlen is much simpler than strncpy, and in particular we
can always pre-align the words we load from memory.  That means that all
the worries about alignment etc are a non-issue, so this one can easily
be used on any architecture.  You obviously do have to do the
appropriate word-at-a-time.h macros.

Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 36126f8f
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment