Index: uspace/lib/c/generic/bitops.c
===================================================================
--- uspace/lib/c/generic/bitops.c	(revision cb2739a35716a85d91d56821607bb7c1756d7c10)
+++ uspace/lib/c/generic/bitops.c	(revision 860a7bb68c0de53fb36b554589d46522e847b95e)
@@ -44,4 +44,14 @@
 }
 
+int __popcountdi2(long a)
+{
+	int bits = 0;
+	for (unsigned int i = 0; i < sizeof(a) * 8; i++)	 {
+		if (((a >> i) & 1) != 0) {
+			bits++;
+		}
+	}
+	return bits;									
+}
 
 /** @}
Index: uspace/lib/c/include/bitops.h
===================================================================
--- uspace/lib/c/include/bitops.h	(revision cb2739a35716a85d91d56821607bb7c1756d7c10)
+++ uspace/lib/c/include/bitops.h	(revision 860a7bb68c0de53fb36b554589d46522e847b95e)
@@ -108,4 +108,5 @@
 
 extern int __popcountsi2(int);
+extern int __popcountdi2(long);
 
 #endif
