From 16a38100b33c4d948014687b3541d5755290c164 Mon Sep 17 00:00:00 2001 From: Asato Wakisaka Date: Thu, 25 May 2017 00:04:41 +0900 Subject: [PATCH] NumProcs() just counts files under f, so use f.Readdirnames to avoid `lstat` syscall inside f.Readdir. --- internal/common/common_linux.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/common/common_linux.go b/internal/common/common_linux.go index 3d0fc50..c0aa9c7 100644 --- a/internal/common/common_linux.go +++ b/internal/common/common_linux.go @@ -35,7 +35,7 @@ func NumProcs() (uint64, error) { } defer f.Close() - list, err := f.Readdir(-1) + list, err := f.Readdirnames(-1) if err != nil { return 0, err }