GitXplorerGitXplorer
t

go-sysconf

public
140 stars
27 forks
1 issues

Commits

List of commits on branch main.
Verified
cb072ababce961c5e624c820605c49607095b201

Merge pull request #136 from tklauser/pr/tklauser/gha-versions

ttklauser committed 3 days ago
Verified
7bf59070fe57b091b0a95c0552c60d221207857e

.github/workflows: add version comments to used actions

ttklauser committed 3 days ago
Unverified
7839cc3cded21c722fe1fcd5ef8416a4fb34ecec

go.mod: bump golang.org/x/sys from 0.28.0 to 0.29.0

ddependabot[bot] committed 12 days ago
Unverified
d8613887cc76afdfbe0b113a5bb92f95aec72375

.github: bump actions/setup-go from 5.1.0 to 5.2.0

ddependabot[bot] committed a month ago
Unverified
ac67c2bce827870c406445e5928ac46447df841c

go.mod: bump golang.org/x/sys from 0.26.0 to 0.28.0

ddependabot[bot] committed a month ago
Unverified
a1887954cc4898a75363177f3d4d5f03e5897f7e

ci: drop unsupported macos-12 runner

ttklauser committed a month ago

README

The README file for this repository.

go-sysconf

Go Reference GitHub Action Status

sysconf for Go, without using cgo or external binaries (e.g. getconf).

Supported operating systems: Linux, macOS, DragonflyBSD, FreeBSD, NetBSD, OpenBSD, Solaris/Illumos.

All POSIX.1 and POSIX.2 variables are supported, see References for a complete list.

Additionally, the following non-standard variables are supported on some operating systems:

Variable Supported on
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

Usage

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)
	}
}

References