aboutsummaryrefslogtreecommitdiffstats
path: root/community/lshw/fix-musl-sc_long_bit.patch
diff options
context:
space:
mode:
Diffstat (limited to 'community/lshw/fix-musl-sc_long_bit.patch')
-rw-r--r--community/lshw/fix-musl-sc_long_bit.patch14
1 files changed, 14 insertions, 0 deletions
diff --git a/community/lshw/fix-musl-sc_long_bit.patch b/community/lshw/fix-musl-sc_long_bit.patch
new file mode 100644
index 0000000000..b409dfe947
--- /dev/null
+++ b/community/lshw/fix-musl-sc_long_bit.patch
@@ -0,0 +1,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);