Source
859
859
int res = 0;
860
860
861
861
for (su1 = cs, su2 = ct; 0 < count; ++su1, ++su2, count--)
862
862
if ((res = *su1 - *su2) != 0)
863
863
break;
864
864
return res;
865
865
}
866
866
EXPORT_SYMBOL(memcmp);
867
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
882
+
int bcmp(const void *a, const void *b, size_t len)
883
+
{
884
+
return memcmp(a, b, len);
885
+
}
886
+
EXPORT_SYMBOL(bcmp);
887
+
#endif
888
+
869
889
#ifndef __HAVE_ARCH_MEMSCAN
870
890
/**
871
891
* memscan - Find a character in an area of memory.
872
892
* @addr: The memory area
873
893
* @c: The byte to search for
874
894
* @size: The size of the area.
875
895
*
876
896
* returns the address of the first occurrence of @c, or 1 byte past
877
897
* the area if @c is not found
878
898
*/