Skip to content
Snippets Groups Projects
Commit 89c181f3 authored by ale's avatar ale
Browse files

Merge branch 'renovate/github.com-tklauser-go-sysconf-0.x' into 'master'

fix(deps): update module github.com/tklauser/go-sysconf to v0.3.14

See merge request !9
parents 63d0a407 2501b890
No related branches found
No related tags found
1 merge request!9fix(deps): update module github.com/tklauser/go-sysconf to v0.3.14
Pipeline #68644 passed with warnings
Showing
with 42 additions and 40 deletions
......@@ -10,5 +10,5 @@ require (
github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90 // indirect
github.com/prometheus/common v0.3.0 // indirect
github.com/prometheus/procfs v0.0.0-20190403104016-ea9eea638872 // indirect
github.com/tklauser/go-sysconf v0.3.13
github.com/tklauser/go-sysconf v0.3.14
)
......@@ -46,11 +46,15 @@ github.com/tklauser/go-sysconf v0.0.0-20190604080227-d90dfe8b2f4b h1:Y4e82WThIQI
github.com/tklauser/go-sysconf v0.0.0-20190604080227-d90dfe8b2f4b/go.mod h1:SdvBWAbFJznngzpDtNfz1UIWi4wGUPYtqtD/Akd/1ms=
github.com/tklauser/go-sysconf v0.3.13 h1:GBUpcahXSpR2xN01jhkNAbTLRk2Yzgggk8IM08lq3r4=
github.com/tklauser/go-sysconf v0.3.13/go.mod h1:zwleP4Q4OehZHGn4CYZDipCgg9usW5IJePewFCGVEa0=
github.com/tklauser/go-sysconf v0.3.14 h1:g5vzr9iPFFz24v2KZXs/pvpvh8/V9Fw6vQK5ZZb78yU=
github.com/tklauser/go-sysconf v0.3.14/go.mod h1:1ym4lWMLUOhuBOPGtRcJm7tEGX4SCYNEEEtghGG/8uY=
github.com/tklauser/numcpus v0.0.0-20181213170026-542d6d9638d9/go.mod h1:Uk6N9CcYOM0f8nBfmdf9874a13Z74bkFHwwvnf5D6/k=
github.com/tklauser/numcpus v0.0.0-20190604080617-6b5085e2650f h1:iBTeCEg2bdbFYOOGrq1fGFUiJkRPLFP5mRTorwUrIB4=
github.com/tklauser/numcpus v0.0.0-20190604080617-6b5085e2650f/go.mod h1:K7nJzFYtUWRfjXkgQ+sFeIqPKTzlujqoTQOc+XQvCE8=
github.com/tklauser/numcpus v0.7.0 h1:yjuerZP127QG9m5Zh/mSO4wqurYil27tHrqwRoRjpr4=
github.com/tklauser/numcpus v0.7.0/go.mod h1:bb6dMVcj8A42tSE7i32fsIUCbQNllK5iDguyOZRUzAY=
github.com/tklauser/numcpus v0.8.0 h1:Mx4Wwe/FjZLeQsK/6kt2EOepwwSl7SmJrK5bV/dXYgY=
github.com/tklauser/numcpus v0.8.0/go.mod h1:ZJZlAY+dmR4eut8epnzf0u/VwodKmryxR8txiloSqBE=
golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4=
golang.org/x/net v0.0.0-20181114220301-adae6a3d119a/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
......@@ -65,6 +69,8 @@ golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a h1:dGzPydgVsqGcTRVwiLJ1jVbuf
golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.15.0 h1:h48lPFYpsTvQJZF4EKyI4aLHaev3CxivZmv7yZig9pc=
golang.org/x/sys v0.15.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
golang.org/x/sys v0.19.0 h1:q5f1RH2jigJ1MoAWp2KTp3gm5zAGFUTarQZ5U386+4o=
golang.org/x/sys v0.19.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
env:
CIRRUS_CLONE_DEPTH: 1
GO_VERSION: go1.21.3
GO_VERSION: go1.22.2
freebsd_12_task:
freebsd_13_task:
freebsd_instance:
image_family: freebsd-12-3
image_family: freebsd-13-2
install_script: |
pkg install -y go
GOBIN=$PWD/bin go install golang.org/dl/${GO_VERSION}@latest
......@@ -12,9 +12,9 @@ freebsd_12_task:
build_script: bin/${GO_VERSION} build -v ./...
test_script: bin/${GO_VERSION} test -race ./...
freebsd_13_task:
freebsd_14_task:
freebsd_instance:
image_family: freebsd-13-0
image_family: freebsd-14-0
install_script: |
pkg install -y go
GOBIN=$PWD/bin go install golang.org/dl/${GO_VERSION}@latest
......
......@@ -3,6 +3,6 @@ module github.com/tklauser/go-sysconf
go 1.18
require (
github.com/tklauser/numcpus v0.7.0
golang.org/x/sys v0.15.0
github.com/tklauser/numcpus v0.8.0
golang.org/x/sys v0.19.0
)
github.com/tklauser/numcpus v0.7.0 h1:yjuerZP127QG9m5Zh/mSO4wqurYil27tHrqwRoRjpr4=
github.com/tklauser/numcpus v0.7.0/go.mod h1:bb6dMVcj8A42tSE7i32fsIUCbQNllK5iDguyOZRUzAY=
golang.org/x/sys v0.15.0 h1:h48lPFYpsTvQJZF4EKyI4aLHaev3CxivZmv7yZig9pc=
golang.org/x/sys v0.15.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
github.com/tklauser/numcpus v0.8.0 h1:Mx4Wwe/FjZLeQsK/6kt2EOepwwSl7SmJrK5bV/dXYgY=
github.com/tklauser/numcpus v0.8.0/go.mod h1:ZJZlAY+dmR4eut8epnzf0u/VwodKmryxR8txiloSqBE=
golang.org/x/sys v0.19.0 h1:q5f1RH2jigJ1MoAWp2KTp3gm5zAGFUTarQZ5U386+4o=
golang.org/x/sys v0.19.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
......@@ -3,7 +3,6 @@
// license that can be found in the LICENSE file.
//go:build darwin || dragonfly || freebsd || netbsd || openbsd
// +build darwin dragonfly freebsd netbsd openbsd
package sysconf
......
......@@ -16,6 +16,10 @@ const (
_HOST_NAME_MAX = _MAXHOSTNAMELEN - 1
_LOGIN_NAME_MAX = _MAXLOGNAME
_SYMLOOP_MAX = _MAXSYMLINKS
// _PTHREAD_STACK_MIN changed in macOS 14
_PTHREAD_STACK_MIN_LT_MACOS14 = 0x2000
_PTHREAD_STACK_MIN_GE_MACOS14 = 0x4000
)
var uname struct {
......@@ -23,6 +27,21 @@ var uname struct {
macOSMajor int
}
func getMacOSMajor() int {
uname.Once.Do(func() {
var u unix.Utsname
err := unix.Uname(&u)
if err != nil {
return
}
rel := unix.ByteSliceToString(u.Release[:])
ver := strings.Split(rel, ".")
maj, _ := strconv.Atoi(ver[0])
uname.macOSMajor = maj
})
return uname.macOSMajor
}
// sysconf implements sysconf(4) as in the Darwin libc (derived from the FreeBSD
// libc), version 1534.81.1.
// See https://github.com/apple-oss-distributions/Libc/tree/Libc-1534.81.1.
......@@ -91,7 +110,10 @@ func sysconf(name int) (int64, error) {
case SC_THREAD_PRIO_PROTECT:
return _POSIX_THREAD_PRIO_PROTECT, nil
case SC_THREAD_STACK_MIN:
return _PTHREAD_STACK_MIN, nil
if getMacOSMajor() < 23 {
return _PTHREAD_STACK_MIN_LT_MACOS14, nil
}
return _PTHREAD_STACK_MIN_GE_MACOS14, nil
case SC_THREAD_THREADS_MAX:
return -1, nil
case SC_TIMER_MAX:
......@@ -140,18 +162,7 @@ func sysconf(name int) (int64, error) {
}
return _POSIX_SEMAPHORES, nil
case SC_SPAWN:
uname.Once.Do(func() {
var u unix.Utsname
err := unix.Uname(&u)
if err != nil {
return
}
rel := unix.ByteSliceToString(u.Release[:])
ver := strings.Split(rel, ".")
maj, _ := strconv.Atoi(ver[0])
uname.macOSMajor = maj
})
if uname.macOSMajor < 22 {
if getMacOSMajor() < 22 {
return -1, nil
}
// macOS 13 (Ventura) and later
......
......@@ -3,7 +3,6 @@
// license that can be found in the LICENSE file.
//go:build darwin || dragonfly || freebsd || linux || netbsd || openbsd
// +build darwin dragonfly freebsd linux netbsd openbsd
package sysconf
......
......@@ -3,7 +3,6 @@
// license that can be found in the LICENSE file.
//go:build darwin || dragonfly || freebsd || linux || openbsd
// +build darwin dragonfly freebsd linux openbsd
package sysconf
......
......@@ -3,7 +3,6 @@
// license that can be found in the LICENSE file.
//go:build !darwin && !dragonfly && !freebsd && !linux && !netbsd && !openbsd && !solaris
// +build !darwin,!dragonfly,!freebsd,!linux,!netbsd,!openbsd,!solaris
package sysconf
......
......@@ -2,7 +2,6 @@
// cgo -godefs sysconf_defs_darwin.go
//go:build darwin
// +build darwin
package sysconf
......@@ -235,7 +234,6 @@ const (
_PTHREAD_DESTRUCTOR_ITERATIONS = 0x4
_PTHREAD_KEYS_MAX = 0x200
_PTHREAD_STACK_MIN = 0x2000
)
const (
......
......@@ -2,7 +2,6 @@
// cgo -godefs sysconf_defs_dragonfly.go
//go:build dragonfly
// +build dragonfly
package sysconf
......
......@@ -2,7 +2,6 @@
// cgo -godefs sysconf_defs_freebsd.go
//go:build freebsd
// +build freebsd
package sysconf
......
......@@ -2,7 +2,6 @@
// cgo -godefs sysconf_defs_linux.go
//go:build linux
// +build linux
package sysconf
......
......@@ -2,7 +2,6 @@
// cgo -godefs sysconf_defs_netbsd.go
//go:build netbsd
// +build netbsd
package sysconf
......
......@@ -2,7 +2,6 @@
// cgo -godefs sysconf_defs_openbsd.go
//go:build openbsd
// +build openbsd
package sysconf
......
......@@ -2,7 +2,6 @@
// cgo -godefs sysconf_defs_solaris.go
//go:build solaris
// +build solaris
package sysconf
......
......@@ -2,7 +2,6 @@
// cgo -godefs sysconf_values_freebsd.go
//go:build freebsd && 386
// +build freebsd,386
package sysconf
......
......@@ -2,7 +2,6 @@
// cgo -godefs sysconf_values_freebsd.go
//go:build freebsd && amd64
// +build freebsd,amd64
package sysconf
......
......@@ -2,7 +2,6 @@
// cgo -godefs sysconf_values_freebsd.go
//go:build freebsd && arm
// +build freebsd,arm
package sysconf
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment