mirror of
https://github.com/moby/moby.git
synced 2026-01-11 18:51:37 +00:00
pkg/fileutils: deprecate GetTotalUsedFds
This function is only used internally and has no external consumers.
Mark it deprecated to be removed in the next release.
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit e45f20352d)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
@@ -150,6 +150,10 @@ issues:
|
||||
path: "api/types/(volume|container)/"
|
||||
linters:
|
||||
- revive
|
||||
# FIXME temporarily suppress these until we migrated these to internal.
|
||||
- text: "SA1019: fileutils\\.GetTotalUsedFds"
|
||||
linters:
|
||||
- staticcheck
|
||||
# FIXME temporarily suppress these (see https://github.com/gotestyourself/gotest.tools/issues/272)
|
||||
- text: "SA1019: (assert|cmp|is)\\.ErrorType is deprecated"
|
||||
linters:
|
||||
|
||||
@@ -14,6 +14,8 @@ import (
|
||||
// "-n", and "-P" options to omit looking up user-names, host-names, and port-
|
||||
// names. See [LSOF(8)].
|
||||
//
|
||||
// Deprecated: this function is only used internally, and will be removed in the next release.
|
||||
//
|
||||
// [LSOF(8)]: https://opensource.apple.com/source/lsof/lsof-49/lsof/lsof.man.auto.html
|
||||
func GetTotalUsedFds() int {
|
||||
output, err := exec.Command("lsof", "-lnP", "-Ff", "-p", strconv.Itoa(os.Getpid())).CombinedOutput()
|
||||
|
||||
@@ -13,6 +13,8 @@ import (
|
||||
|
||||
// GetTotalUsedFds Returns the number of used File Descriptors by
|
||||
// reading it via /proc filesystem.
|
||||
//
|
||||
// Deprecated: this function is only used internally, and will be removed in the next release.
|
||||
func GetTotalUsedFds(ctx context.Context) int {
|
||||
ctx, span := tracing.StartSpan(ctx, "GetTotalUsedFds")
|
||||
defer span.End()
|
||||
|
||||
@@ -4,6 +4,8 @@ import "context"
|
||||
|
||||
// GetTotalUsedFds Returns the number of used File Descriptors. Not supported
|
||||
// on Windows.
|
||||
//
|
||||
// Deprecated: this function is only used internally, and will be removed in the next release.
|
||||
func GetTotalUsedFds(ctx context.Context) int {
|
||||
return -1
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user