mirror of
https://github.com/opencontainers/runc.git
synced 2026-07-11 14:13:58 +08:00
15c93ee9e0
Revert: #935 Fixes: #946 I can reproduce #946 on some machines, the problem is on some machines, it could be very fast that modify time of `memory.kmem.limit_in_bytes` could be the same as before it's modified. And now we'll call `SetKernelMemory` twice on container creation which cause the second time failure. Revert this before we find a better solution. Signed-off-by: Qiang Huang <h.huangqiang@huawei.com>
32 lines
477 B
Go
32 lines
477 B
Go
// +build cgo,linux cgo,freebsd
|
|
|
|
package system
|
|
|
|
/*
|
|
#include <unistd.h>
|
|
#include <limits.h>
|
|
|
|
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"
|
|
|
|
func GetClockTicks() int {
|
|
return int(C.sysconf(C._SC_CLK_TCK))
|
|
}
|
|
|
|
func GetLongBit() int {
|
|
return int(C.GetLongBit())
|
|
}
|