summaryrefslogtreecommitdiffstats
path: root/lib/string.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/string.c')
-rw-r--r--lib/string.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/lib/string.c b/lib/string.c
index 38e4ca08e757..3ab861c1a857 100644
--- a/lib/string.c
+++ b/lib/string.c
@@ -866,6 +866,26 @@ __visible int memcmp(const void *cs, const void *ct, size_t count)
866EXPORT_SYMBOL(memcmp); 866EXPORT_SYMBOL(memcmp);
867#endif 867#endif
868 868
869#ifndef __HAVE_ARCH_BCMP
870/**
871 * bcmp - returns 0 if and only if the buffers have identical contents.
872 * @a: pointer to first buffer.
873 * @b: pointer to second buffer.
874 * @len: size of buffers.
875 *
876 * The sign or magnitude of a non-zero return value has no particular
877 * meaning, and architectures may implement their own more efficient bcmp(). So
878 * while this particular implementation is a simple (tail) call to memcmp, do
879 * not rely on anything but whether the return value is zero or non-zero.
880 */
881#undef bcmp
882int bcmp(const void *a, const void *b, size_t len)
883{
884 return memcmp(a, b, len);
885}
886EXPORT_SYMBOL(bcmp);
887#endif
888
869#ifndef __HAVE_ARCH_MEMSCAN 889#ifndef __HAVE_ARCH_MEMSCAN
870/** 890/**
871 * memscan - Find a character in an area of memory. 891 * memscan - Find a character in an area of memory.