mirror of
https://github.com/opencontainers/runc.git
synced 2026-07-11 06:03:57 +08:00
fcd966f501
Signed-off-by: Buddha Prakash <buddhap@google.com>
28 lines
422 B
Go
28 lines
422 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))
|
|
}
|