diff --git a/num_fd.go b/num_fd.go index 9806802..ebe98bb 100644 --- a/num_fd.go +++ b/num_fd.go @@ -43,6 +43,8 @@ func countDir(dir string) int { return len(names) - 1 // for the dir we just opened } +// NumFD returns the number of open file descriptors (or -1 on error). +// On windows it returns the number of handles. func NumFD() int { switch runtime.GOOS { case "windows": diff --git a/scli.go b/scli.go index e57e999..947f1c3 100644 --- a/scli.go +++ b/scli.go @@ -9,6 +9,8 @@ // Configure using the [cli] package variables (at minimum [MinArgs] unless your // binary only accepts flags), setup additional [flag] before calling // [ServerMain]. +// It also includes [NumFD] utility function to cross platform get the number +// of open file descriptors (handles on windows) held by your go process. package scli // import "fortio.org/scli" import (