diff --git a/libcontainer/system/sysconfig.go b/libcontainer/system/sysconfig.go index 3e3d7e01e..4fba6c2b7 100644 --- a/libcontainer/system/sysconfig.go +++ b/libcontainer/system/sysconfig.go @@ -4,6 +4,21 @@ package system /* #include +#include + +int GetLongBit() { +#ifdef _SC_LONG_BIT + int longbits; + + longbits = sysconf(_SC_LONG_BIT); + if (longbits < 0) { + longbits = (CHAR_BIT * sizeof(long)); + } + return longbits; +#else + return (CHAR_BIT * sizeof(long)); +#endif +} */ import "C" @@ -12,5 +27,5 @@ func GetClockTicks() int { } func GetLongBit() int { - return int(C.sysconf(C._SC_LONG_BIT)) + return int(C.GetLongBit()) }