Upstream musl libc defines sysinfo.uptime as unsigned long, while the
kernel and glibc define it as long. Cast it to long for the
comparision.
Bug: 190084016
Test: bionic-unit-tests-glibc
Change-Id: Ib322472d512a9a7474a936e33f35523e1dc995d9
We know game developers (and the Games SDK) look at this stuff, so make
a bit more of an effort to ensure it's not completely broken.
Test: treehugger
Change-Id: I20b1c167faa1d9f4f39a94a723dabb848ce34269
The number of available physical pages is not constant and can
potentially change between calls to get_avphys_pages and
sysconf(_SC_AVPHYS_PAGES) calls.
Relax the assert to check that sconf(_SC_AVPHYS_PAGES) <= phys_pages.
Bug: http://b/31502852
Test: build and run bionic-unit-tests
Change-Id: Ibf8873d2151d93239391d2638dfbf055b70cde3a
We already had implementations of some of the functions, and I didn't
bother rewriting them when we added sysinfo(2). Ross Anderson said in
https://www.lightbluetouchpaper.org/2016/07/29/yet-another-android-side-channel/
that we should "simply disable access to all procfs files", which made
me curious how many places we use /proc in bionic. This is the one that's
obviously unnecessary. The others I'm not aware of alternative APIs for.
Change-Id: Ia64f36b76f29a7a1dd67845270a5472e121aae10