mirror of
https://github.com/opencontainers/runc.git
synced 2025-09-26 19:41:35 +08:00
Require Go 1.23.x, drop Go 1.22 support
Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
This commit is contained in:
7
go.mod
7
go.mod
@@ -1,11 +1,6 @@
|
|||||||
module github.com/opencontainers/runc
|
module github.com/opencontainers/runc
|
||||||
|
|
||||||
go 1.22
|
go 1.23.0
|
||||||
|
|
||||||
// Suggest toolchain 1.22.4 due to a fix in golang for libcontainer/nsenter/.
|
|
||||||
// For more info, see: #4233
|
|
||||||
// Note that toolchain does not impose a requirement on other modules using runc.
|
|
||||||
toolchain go1.22.4
|
|
||||||
|
|
||||||
require (
|
require (
|
||||||
github.com/checkpoint-restore/go-criu/v6 v6.3.0
|
github.com/checkpoint-restore/go-criu/v6 v6.3.0
|
||||||
|
@@ -1,27 +0,0 @@
|
|||||||
//go:build !go1.23
|
|
||||||
|
|
||||||
// TODO: remove this file once go 1.22 is no longer supported.
|
|
||||||
|
|
||||||
package system
|
|
||||||
|
|
||||||
import (
|
|
||||||
"sync/atomic"
|
|
||||||
"syscall"
|
|
||||||
_ "unsafe" // Needed for go:linkname to work.
|
|
||||||
)
|
|
||||||
|
|
||||||
//go:linkname syscallOrigRlimitNofile syscall.origRlimitNofile
|
|
||||||
var syscallOrigRlimitNofile atomic.Pointer[syscall.Rlimit]
|
|
||||||
|
|
||||||
// ClearRlimitNofileCache clears go runtime's nofile rlimit cache.
|
|
||||||
// The argument is process RLIMIT_NOFILE values.
|
|
||||||
func ClearRlimitNofileCache(_ *syscall.Rlimit) {
|
|
||||||
// As reported in issue #4195, the new version of go runtime(since 1.19)
|
|
||||||
// will cache rlimit-nofile. Before executing execve, the rlimit-nofile
|
|
||||||
// of the process will be restored with the cache. In runc, this will
|
|
||||||
// cause the rlimit-nofile setting by the parent process for the container
|
|
||||||
// to become invalid. It can be solved by clearing this cache. But
|
|
||||||
// unfortunately, go stdlib doesn't provide such function, so we need to
|
|
||||||
// link to the private var `origRlimitNofile` in package syscall to hack.
|
|
||||||
syscallOrigRlimitNofile.Store(nil)
|
|
||||||
}
|
|
Reference in New Issue
Block a user