@@ -19,14 +19,15 @@ import (
1919//go:linkname syscallOrigRlimitNofile syscall.origRlimitNofile
2020var syscallOrigRlimitNofile atomic.Pointer [syscall.Rlimit ]
2121
22- // As reported in issue #4195, the new version of go runtime(since 1.19)
23- // will cache rlimit-nofile. Before executing execve, the rlimit-nofile
24- // of the process will be restored with the cache. In runc, this will
25- // cause the rlimit-nofile setting by the parent process for the container
26- // to become invalid. It can be solved by clearing this cache. But
27- // unfortunately, go stdlib doesn't provide such function, so we need to
28- // link to the private var `origRlimitNofile` in package syscall to hack.
22+ // ClearRlimitNofileCache is to clear go runtime's nofile rlimit cache.
2923func ClearRlimitNofileCache () {
24+ // As reported in issue #4195, the new version of go runtime(since 1.19)
25+ // will cache rlimit-nofile. Before executing execve, the rlimit-nofile
26+ // of the process will be restored with the cache. In runc, this will
27+ // cause the rlimit-nofile setting by the parent process for the container
28+ // to become invalid. It can be solved by clearing this cache. But
29+ // unfortunately, go stdlib doesn't provide such function, so we need to
30+ // link to the private var `origRlimitNofile` in package syscall to hack.
3031 syscallOrigRlimitNofile .Store (nil )
3132}
3233
0 commit comments