Index: uspace/app/bdsh/cmds/modules/cmp/cmp.c
===================================================================
--- uspace/app/bdsh/cmds/modules/cmp/cmp.c	(revision eef14771b77663fec606dbe440c7f1f7cb1f78be)
+++ uspace/app/bdsh/cmds/modules/cmp/cmp.c	(revision 44ecf894e75e499c21daf2e1b5fbc588301e35e5)
@@ -107,5 +107,5 @@
 
 		if (offset[0] != offset[1] ||
-		    bcmp(buffer[0], buffer[1], offset[0])) {
+		    memcmp(buffer[0], buffer[1], offset[0]) != 0) {
 			rc = 1;
 			goto end;
Index: uspace/lib/bithenge/src/blob.c
===================================================================
--- uspace/lib/bithenge/src/blob.c	(revision eef14771b77663fec606dbe440c7f1f7cb1f78be)
+++ uspace/lib/bithenge/src/blob.c	(revision 44ecf894e75e499c21daf2e1b5fbc588301e35e5)
@@ -477,5 +477,5 @@
 		if (rc != EOK)
 			return rc;
-		if (size_a != size_b || bcmp(buffer_a, buffer_b, size_a)) {
+		if (size_a != size_b || memcmp(buffer_a, buffer_b, size_a) != 0) {
 			*out = false;
 			return EOK;
Index: uspace/lib/c/generic/mem.c
===================================================================
--- uspace/lib/c/generic/mem.c	(revision eef14771b77663fec606dbe440c7f1f7cb1f78be)
+++ uspace/lib/c/generic/mem.c	(revision 44ecf894e75e499c21daf2e1b5fbc588301e35e5)
@@ -224,19 +224,25 @@
  * @param s1  Pointer to the first area to compare.
  * @param s2  Pointer to the second area to compare.
- * @param len Size of the first area in bytes. Both areas must have
- *            the same length.
- *
- * @return If len is 0, return zero. If the areas match, return
- *         zero. Otherwise return non-zero.
- *
- */
-int bcmp(const void *s1, const void *s2, size_t len)
+ * @param len Size of the areas in bytes.
+ *
+ * @return Zero if areas have the same contents. If they differ,
+ *	   the sign of the result is the same as the sign of the
+ *	   difference of the first pair of different bytes.
+ *
+ */
+int memcmp(const void *s1, const void *s2, size_t len)
 {
 	uint8_t *u1 = (uint8_t *) s1;
 	uint8_t *u2 = (uint8_t *) s2;
-	
-	for (; (len != 0) && (*u1++ == *u2++); len--);
-	
-	return len;
+	size_t i;
+
+	for (i = 0; i < len; i++) {
+		if (*u1 != *u2)
+			return (int)(*u1) - (int)(*u2);
+		++u1;
+		++u2;
+	}
+
+	return 0;
 }
 
Index: uspace/lib/c/include/mem.h
===================================================================
--- uspace/lib/c/include/mem.h	(revision eef14771b77663fec606dbe440c7f1f7cb1f78be)
+++ uspace/lib/c/include/mem.h	(revision 44ecf894e75e499c21daf2e1b5fbc588301e35e5)
@@ -45,6 +45,5 @@
     __attribute__ ((optimize("-fno-tree-loop-distribute-patterns")));
 extern void *memmove(void *, const void *, size_t);
-
-extern int bcmp(const void *, const void *, size_t);
+extern int memcmp(const void *, const void *, size_t);
 
 #endif
Index: uspace/lib/ext4/libext4_directory.c
===================================================================
--- uspace/lib/ext4/libext4_directory.c	(revision eef14771b77663fec606dbe440c7f1f7cb1f78be)
+++ uspace/lib/ext4/libext4_directory.c	(revision 44ecf894e75e499c21daf2e1b5fbc588301e35e5)
@@ -725,5 +725,5 @@
 			    name_len) {
 				/* Compare names */
-				if (bcmp((uint8_t *) name, dentry->name, name_len) == 0) {
+				if (memcmp((uint8_t *) name, dentry->name, name_len) == 0) {
 					*res_entry = dentry;
 					return EOK;
Index: uspace/lib/nic/src/nic_addr_db.c
===================================================================
--- uspace/lib/nic/src/nic_addr_db.c	(revision eef14771b77663fec606dbe440c7f1f7cb1f78be)
+++ uspace/lib/nic/src/nic_addr_db.c	(revision 44ecf894e75e499c21daf2e1b5fbc588301e35e5)
@@ -70,5 +70,5 @@
 	nic_addr_entry_t *entry = member_to_inst(item, nic_addr_entry_t, link);
 	
-	return 0 == bcmp(entry->addr, key->addr, entry->len);
+	return memcmp(entry->addr, key->addr, entry->len) == 0;
 }
 
Index: uspace/lib/posix/source/strings.c
===================================================================
--- uspace/lib/posix/source/strings.c	(revision eef14771b77663fec606dbe440c7f1f7cb1f78be)
+++ uspace/lib/posix/source/strings.c	(revision 44ecf894e75e499c21daf2e1b5fbc588301e35e5)
@@ -131,5 +131,5 @@
 int posix_bcmp(const void *mem1, const void *mem2, size_t n)
 {
-	return bcmp(mem1, mem2, n);
+	return memcmp(mem1, mem2, n);
 }
 
Index: uspace/srv/fs/cdfs/cdfs_ops.c
===================================================================
--- uspace/srv/fs/cdfs/cdfs_ops.c	(revision eef14771b77663fec606dbe440c7f1f7cb1f78be)
+++ uspace/srv/fs/cdfs/cdfs_ops.c	(revision 44ecf894e75e499c21daf2e1b5fbc588301e35e5)
@@ -660,5 +660,5 @@
 	 */
 	if ((vol_desc->type != VOL_DESC_PRIMARY) ||
-	    (bcmp(vol_desc->standard_ident, CDFS_STANDARD_IDENT, 5) != 0) ||
+	    (memcmp(vol_desc->standard_ident, CDFS_STANDARD_IDENT, 5) != 0) ||
 	    (vol_desc->version != 1)) {
 		block_put(block);
Index: uspace/srv/fs/fat/fat_directory.c
===================================================================
--- uspace/srv/fs/fat/fat_directory.c	(revision eef14771b77663fec606dbe440c7f1f7cb1f78be)
+++ uspace/srv/fs/fat/fat_directory.c	(revision 44ecf894e75e499c21daf2e1b5fbc588301e35e5)
@@ -516,6 +516,6 @@
 			return false;
 		case FAT_DENTRY_VALID:
-			if (bcmp(de->name, d->name,
-			    FAT_NAME_LEN + FAT_EXT_LEN)==0)
+			if (memcmp(de->name, d->name,
+			    FAT_NAME_LEN + FAT_EXT_LEN) == 0)
 				return true;
 			break;
Index: uspace/srv/fs/fat/fat_ops.c
===================================================================
--- uspace/srv/fs/fat/fat_ops.c	(revision eef14771b77663fec606dbe440c7f1f7cb1f78be)
+++ uspace/srv/fs/fat/fat_ops.c	(revision 44ecf894e75e499c21daf2e1b5fbc588301e35e5)
@@ -651,5 +651,5 @@
 		d = (fat_dentry_t *) b->data;
 		if ((fat_classify_dentry(d) == FAT_DENTRY_LAST) ||
-		    (bcmp(d->name, FAT_NAME_DOT, FAT_NAME_LEN)) == 0) {
+		    (memcmp(d->name, FAT_NAME_DOT, FAT_NAME_LEN)) == 0) {
 			memset(d, 0, sizeof(fat_dentry_t));
 			memcpy(d->name, FAT_NAME_DOT, FAT_NAME_LEN);
@@ -661,5 +661,5 @@
 		d++;
 		if ((fat_classify_dentry(d) == FAT_DENTRY_LAST) ||
-		    (bcmp(d->name, FAT_NAME_DOT_DOT, FAT_NAME_LEN) == 0)) {
+		    (memcmp(d->name, FAT_NAME_DOT_DOT, FAT_NAME_LEN) == 0)) {
 			memset(d, 0, sizeof(fat_dentry_t));
 			memcpy(d->name, FAT_NAME_DOT_DOT, FAT_NAME_LEN);
@@ -1042,7 +1042,7 @@
 	info = (fat32_fsinfo_t *) b->data;
 
-	if (bcmp(info->sig1, FAT32_FSINFO_SIG1, sizeof(info->sig1)) ||
-	    bcmp(info->sig2, FAT32_FSINFO_SIG2, sizeof(info->sig2)) ||
-	    bcmp(info->sig3, FAT32_FSINFO_SIG3, sizeof(info->sig3))) {
+	if (memcmp(info->sig1, FAT32_FSINFO_SIG1, sizeof(info->sig1)) != 0 ||
+	    memcmp(info->sig2, FAT32_FSINFO_SIG2, sizeof(info->sig2)) != 0 ||
+	    memcmp(info->sig3, FAT32_FSINFO_SIG3, sizeof(info->sig3)) != 0) {
 		(void) block_put(b);
 		return EINVAL;
Index: uspace/srv/fs/mfs/mfs_dentry.c
===================================================================
--- uspace/srv/fs/mfs/mfs_dentry.c	(revision eef14771b77663fec606dbe440c7f1f7cb1f78be)
+++ uspace/srv/fs/mfs/mfs_dentry.c	(revision 44ecf894e75e499c21daf2e1b5fbc588301e35e5)
@@ -178,5 +178,5 @@
 
 		if (name_len == d_name_len &&
-		    !bcmp(d_info.d_name, d_name, name_len)) {
+		    memcmp(d_info.d_name, d_name, name_len) == 0) {
 
 			d_info.d_inum = 0;
Index: uspace/srv/fs/mfs/mfs_ops.c
===================================================================
--- uspace/srv/fs/mfs/mfs_ops.c	(revision eef14771b77663fec606dbe440c7f1f7cb1f78be)
+++ uspace/srv/fs/mfs/mfs_ops.c	(revision 44ecf894e75e499c21daf2e1b5fbc588301e35e5)
@@ -452,5 +452,5 @@
 
 		if (comp_size == dentry_name_size &&
-		    !bcmp(component, d_info.d_name, dentry_name_size)) {
+		    memcmp(component, d_info.d_name, dentry_name_size) == 0) {
 			/* Hit! */
 			mfs_node_core_get(rfn, mnode->instance,
Index: uspace/srv/fs/udf/udf_volume.c
===================================================================
--- uspace/srv/fs/udf/udf_volume.c	(revision eef14771b77663fec606dbe440c7f1f7cb1f78be)
+++ uspace/srv/fs/udf/udf_volume.c	(revision 44ecf894e75e499c21daf2e1b5fbc588301e35e5)
@@ -262,9 +262,9 @@
 		 * and Descriptor char set field.
 		 */
-		if ((bcmp((uint8_t *) pvd[i].volume_id,
+		if ((memcmp((uint8_t *) pvd[i].volume_id,
 		    (uint8_t *) desc->volume_id, 32) == 0) &&
-		    (bcmp((uint8_t *) pvd[i].volume_set_id,
+		    (memcmp((uint8_t *) pvd[i].volume_set_id,
 		    (uint8_t *) desc->volume_set_id, 128) == 0) &&
-		    (bcmp((uint8_t *) &pvd[i].descriptor_charset,
+		    (memcmp((uint8_t *) &pvd[i].descriptor_charset,
 		    (uint8_t *) &desc->descriptor_charset, 64) == 0) &&
 		    (FLE32(desc->sequence_number) > FLE32(pvd[i].sequence_number))) {
@@ -301,7 +301,7 @@
 		 * Logic Volume Identifier and Descriptor char set field.
 		 */
-		if ((bcmp((uint8_t *) lvd[i].logical_volume_id,
+		if ((memcmp((uint8_t *) lvd[i].logical_volume_id,
 		    (uint8_t *) desc->logical_volume_id, 128) == 0) &&
-		    (bcmp((uint8_t *) &lvd[i].charset,
+		    (memcmp((uint8_t *) &lvd[i].charset,
 		    (uint8_t *) &desc->charset, 64) == 0) &&
 		    (FLE32(desc->sequence_number) > FLE32(lvd[i].sequence_number))) {
