...

Source file src/github.com/tklauser/go-sysconf/sysconf.go

Documentation: github.com/tklauser/go-sysconf

     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  
     5  // Package sysconf implements the sysconf(3) function and provides the
     6  // associated SC_* constants to query system configuration values.
     7  package sysconf
     8  
     9  import "errors"
    10  
    11  //go:generate go run mksysconf.go
    12  
    13  var errInvalid = errors.New("invalid parameter value")
    14  
    15  // Sysconf returns the value of a sysconf(3) runtime system parameter.
    16  // The name parameter should be a SC_* constant define in this package. The
    17  // implementation is GOOS-specific and certain SC_* constants might not be
    18  // defined for all GOOSes.
    19  func Sysconf(name int) (int64, error) {
    20  	return sysconf(name)
    21  }
    22  

View as plain text