F(x)tec Pro1 >> Sailfish

解決"undefined reference to bcmp"問題


參考資訊:
1. patch

添加如下程式到lib/string.c

#ifdef __HAVE_ARCH_MEMCMP
int bcmp(const void *cs, const void *ct, size_t n)
{
       return memcmp(cs, ct, n);
}
EXPORT_SYMBOL(bcmp);
#else
/**
 * memcmp - Compare two areas of memory
 * @cs: One area of memory
 * @ct: Another area of memory
 * @count: The size of the area.
 */
#undef memcmp
__visible int memcmp(const void *cs, const void *ct, size_t count)
{
	const unsigned char *su1, *su2;
	int res = 0;

	for (su1 = cs, su2 = ct; 0 < count; ++su1, ++su2, count--)
		if ((res = *su1 - *su2) != 0)
			break;
	return res;
}
EXPORT_SYMBOL(memcmp);
#endif


返回上一頁