mirror of
https://github.com/tailscale/tailscale.git
synced 2025-04-16 03:31:39 +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 (
|
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
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user