1 /* 2 * Copyright (C) 1991, 1992 Linus Torvalds 3 */ 4 5 #include <xen/string.h> 6 7 /** 8 * memcmp - Compare two areas of memory 9 * @cs: One area of memory 10 * @ct: Another area of memory 11 * @count: The size of the area. 12 */ 13 int (memcmp)(const void *cs, const void *ct, size_t count) 14 { 15 const unsigned char *su1, *su2; 16 int res = 0; 17 18 for( su1 = cs, su2 = ct; 0 < count; ++su1, ++su2, count--) 19 if ((res = *su1 - *su2) != 0) 20 break; 21 return res; 22 } 23 24 /* 25 * Local variables: 26 * mode: C 27 * c-file-style: "BSD" 28 * c-basic-offset: 8 29 * tab-width: 8 30 * indent-tabs-mode: t 31 * End: 32 */ 33