@@ -2,11 +2,11 @@
package watcher
-// MaximizeOpenFileLimit is a no-op on non-Unix systems.
+// maximizeOpenFileLimit is a no-op on non-Unix systems.
// Returns a high value to indicate no practical limit.
-func MaximizeOpenFileLimit() (int, error) {
+func maximizeOpenFileLimit() (int, error) {
// Windows and other non-Unix systems don't have file descriptor limits
// in the same way Unix systems do. Return a very high value to indicate
// there's no practical limit to worry about.
return 10000000, nil // 10M handles - way more than any process would use
-}
+}
@@ -16,11 +16,11 @@ const (
darwinOpenMax = 10240
)
-// MaximizeOpenFileLimit tries to set the resource limit RLIMIT_NOFILE (number
+// maximizeOpenFileLimit tries to set the resource limit RLIMIT_NOFILE (number
// of open file descriptors) to the max (hard limit), if the current (soft
// limit) is below the max. Returns the new (though possibly unchanged) limit,
// or an error if it could not be changed.
-func MaximizeOpenFileLimit() (int, error) {
+func maximizeOpenFileLimit() (int, error) {
// Get the current limit on number of open files.
var lim syscall.Rlimit
if err := syscall.Getrlimit(syscall.RLIMIT_NOFILE, &lim); err != nil {