Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 2 commits into from Nov 19, 2022

Conversation

tmm1
Copy link
Contributor

@tmm1 tmm1 commented Oct 11, 2022

these are not accessible on Android

@Lomanic
Copy link
Collaborator

Lomanic commented Oct 12, 2022

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.

@tmm1 tmm1 force-pushed the android-uptime branch 4 times, most recently from 42f7a7c to 07e73f9 Compare October 14, 2022 21:13
with Android O, /proc/{stat,uptime} both return permission denied
@tmm1
Copy link
Contributor Author

tmm1 commented Oct 14, 2022

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
Copy link
Contributor Author

tmm1 commented Oct 17, 2022

@Lomanic wdyt?

@tmm1
Copy link
Contributor Author

tmm1 commented Oct 24, 2022

Friendly ping

@tmm1
Copy link
Contributor Author

tmm1 commented Oct 26, 2022

Thanks for the review! How is this looking now?

@tmm1
Copy link
Contributor Author

tmm1 commented Nov 18, 2022

ping @shirou

@Lomanic Lomanic merged commit 34cc43d into shirou:master Nov 19, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants