--- a/src/core/abi.cc
+++ b/src/core/abi.cc
@@ -21,7 +21,11 @@
 {
   // are we compiled as 32- or 64-bit process ?
   long sc = sysconf(LONG_BIT);
+#ifdef _SC_LONG_BIT
   if(sc==-1) sc = sysconf(_SC_LONG_BIT);
+#else
+  if(sc==-1) sc = (CHAR_BIT * sizeof(long));
+#endif
   if(sc!=-1) system.setWidth(sc);
 
   pushd(PROC_SYS);
