-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #4299 from kolyshkin/1.1-4290
[1.1] libct/system: ClearRlimitNofileCache for go 1.23
- Loading branch information
Showing
4 changed files
with
34 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
//go:build go1.23 | ||
|
||
package system | ||
|
||
import ( | ||
"syscall" | ||
) | ||
|
||
// ClearRlimitNofileCache clears go runtime's nofile rlimit cache. The argument | ||
// is process RLIMIT_NOFILE values. Relies on go.dev/cl/588076. | ||
func ClearRlimitNofileCache(lim *syscall.Rlimit) { | ||
// Ignore the return values since we only need to clean the cache, | ||
// the limit is going to be set via unix.Prlimit elsewhere. | ||
_ = syscall.Setrlimit(syscall.RLIMIT_NOFILE, lim) | ||
} |
12 changes: 7 additions & 5 deletions
12
libcontainer/system/rlimit_go119.go → libcontainer/system/rlimit_linux_go122.go
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters