Blob Blame History Raw
From cb3c2999b586aaef7e5bd5ba60f1e3631ec756c1 Mon Sep 17 00:00:00 2001
From: Lyonel Vincent <lyonel@ezix.org>
Date: Fri, 6 May 2016 16:38:38 +0200
Subject: [PATCH 06/43] fix #714 (system width detection)

---
 src/core/abi.cc | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/src/core/abi.cc b/src/core/abi.cc
index 76e5082..adff7b5 100644
--- a/src/core/abi.cc
+++ b/src/core/abi.cc
@@ -20,7 +20,9 @@ __ID("@(#) $Id: mem.cc 1352 2006-05-27 23:54:13Z ezix $");
 bool scan_abi(hwNode & system)
 {
   // are we compiled as 32- or 64-bit process ?
-  system.setWidth(sysconf(LONG_BIT));
+  long sc = sysconf(LONG_BIT);
+  if(sc==-1) sc = sysconf(_SC_LONG_BIT);
+  if(sc!=-1) system.setWidth(sc);
 
   pushd(PROC_SYS);
 
-- 
2.10.2