go sysconf
v0.3.14
sysconf
para GO, sin usar CGO o binarios externos (por ejemplo, getConf).
Sistemas operativos compatibles: Linux, MacOS, DragonFlybsD, FreeBSD, NetBSD, OpenBSD, Solaris/Illumos.
Se admiten todas las variables POSIX.1 y POSIX.2, consulte las referencias para una lista completa.
Además, las siguientes variables no estándar son compatibles con algunos sistemas operativos:
Variable | Apoyado en |
---|---|
SC_PHYS_PAGES | Linux, MacOS, FreeBSD, NetBSD, OpenBSD, Solaris/Illumos |
SC_AVPHYS_PAGES | Linux, OpenBSD, Solaris/Illumos |
SC_NPROCESSORS_CONF | Linux, MacOS, FreeBSD, NetBSD, OpenBSD, Solaris/Illumos |
SC_NPROCESSORS_ONLN | Linux, MacOS, FreeBSD, NetBSD, OpenBSD, Solaris/Illumos |
SC_UIO_MAXIOV | Linux |
package main
import (
"fmt"
"github.com/tklauser/go-sysconf"
)
func main () {
// get clock ticks, this will return the same as C.sysconf(C._SC_CLK_TCK)
clktck , err := sysconf . Sysconf ( sysconf . SC_CLK_TCK )
if err == nil {
fmt . Printf ( "SC_CLK_TCK: %v n " , clktck )
}
}
sysconf
sysconf(3)
sysconf