gopsutil icon indicating copy to clipboard operation
gopsutil copied to clipboard

[android][host] fix Info() failure due to forbidden /proc/stat and /proc/uptime

Open tmm1 opened this issue 3 years ago • 3 comments

these are not accessible on Android

tmm1 avatar Oct 11 '22 20:10 tmm1

These files are still accessible on older Android versions (in my test, Android 7.1.2), this change needlessly breaks the function there.

We could use https://pkg.go.dev/golang.org/x/sys/unix#Sysinfo, maybe as a fallback to a read error.

Lomanic avatar Oct 12 '22 14:10 Lomanic

We could use https://pkg.go.dev/golang.org/x/sys/unix#Sysinfo, maybe as a fallback to a read error.

Good idea. I have implemented this approach on the PR, and tested working with Android 11

tmm1 avatar Oct 14 '22 21:10 tmm1

@Lomanic wdyt?

tmm1 avatar Oct 17 '22 23:10 tmm1

Friendly ping

tmm1 avatar Oct 24 '22 19:10 tmm1

Thanks for the review! How is this looking now?

tmm1 avatar Oct 26 '22 16:10 tmm1

ping @shirou

tmm1 avatar Nov 18 '22 18:11 tmm1