summaryrefslogtreecommitdiff
path: root/repo/lshw/fix-musl-sc_long_bit.patch
blob: b409dfe94738185ea5e202feddcadf7a25442856 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
--- 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);