mirror of
https://github.com/tailscale/tailscale.git
synced 2025-02-18 02:48:40 +00:00
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:
parent
d20392d413
commit
66d7d2549f
@ -9,12 +9,13 @@ package logger
|
||||
|
||||
import (
|
||||
"runtime"
|
||||
"syscall"
|
||||
|
||||
"golang.org/x/sys/unix"
|
||||
)
|
||||
|
||||
func rusageMaxRSS() float64 {
|
||||
var ru syscall.Rusage
|
||||
err := syscall.Getrusage(syscall.RUSAGE_SELF, &ru)
|
||||
var ru unix.Rusage
|
||||
err := unix.Getrusage(unix.RUSAGE_SELF, &ru)
|
||||
if err != nil {
|
||||
return 0
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user