sysconf.go 736 B

123456789101112131415161718192021
  1. // Copyright 2018 Tobias Klauser. All rights reserved.
  2. // Use of this source code is governed by a BSD-style
  3. // license that can be found in the LICENSE file.
  4. // Package sysconf implements the sysconf(3) function and provides the
  5. // associated SC_* constants to query system configuration values.
  6. package sysconf
  7. import "errors"
  8. //go:generate go run mksysconf.go
  9. var errInvalid = errors.New("invalid parameter value")
  10. // Sysconf returns the value of a sysconf(3) runtime system parameter.
  11. // The name parameter should be a SC_* constant define in this package. The
  12. // implementation is GOOS-specific and certain SC_* constants might not be
  13. // defined for all GOOSes.
  14. func Sysconf(name int) (int64, error) {
  15. return sysconf(name)
  16. }