logger: migrate rusage syscall use to x/sys/unix

This will be helpful for illumos (#697) and should be safe
everywhere else.

Signed-off-by: Nahum Shalman <nahamu@gmail.com>
This commit is contained in:
Nahum Shalman 2022-08-28 14:41:41 +00:00 committed by Brad Fitzpatrick
parent d20392d413
commit 66d7d2549f

View File

@ -9,12 +9,13 @@ package logger
import ( import (
"runtime" "runtime"
"syscall"
"golang.org/x/sys/unix"
) )
func rusageMaxRSS() float64 { func rusageMaxRSS() float64 {
var ru syscall.Rusage var ru unix.Rusage
err := syscall.Getrusage(syscall.RUSAGE_SELF, &ru) err := unix.Getrusage(unix.RUSAGE_SELF, &ru)
if err != nil { if err != nil {
return 0 return 0
} }