Skip to content

Commit 66d7d25

Browse files
nshalmanbradfitz
authored andcommitted
logger: migrate rusage syscall use to x/sys/unix
This will be helpful for illumos (tailscale#697) and should be safe everywhere else. Signed-off-by: Nahum Shalman <nahamu@gmail.com>
1 parent d20392d commit 66d7d25

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

types/logger/rusage_syscall.go

+4-3
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,13 @@ package logger
99

1010
import (
1111
"runtime"
12-
"syscall"
12+
13+
"golang.org/x/sys/unix"
1314
)
1415

1516
func rusageMaxRSS() float64 {
16-
var ru syscall.Rusage
17-
err := syscall.Getrusage(syscall.RUSAGE_SELF, &ru)
17+
var ru unix.Rusage
18+
err := unix.Getrusage(unix.RUSAGE_SELF, &ru)
1819
if err != nil {
1920
return 0
2021
}

0 commit comments

Comments
 (0)