Fix overflow in get_phys_pages and get_avphys_pages.

On LP32 mem_unit will be 4096 to allow more than 4GiB in the "ulong"
fields, but we need to promote to a 64-bit type before we multiply.

Bug: N/A
Test: tested manually with an x86 static binary on my 64GiB desktop.
Signed-off-by: YiPing Xu <xuyiping@hisilicon.com>
Change-Id: Id663932503b75793bb7c26a008129f3e2e4cccbf
diff --git a/libc/bionic/sysinfo.cpp b/libc/bionic/sysinfo.cpp
index 304634a..947de95 100644
--- a/libc/bionic/sysinfo.cpp
+++ b/libc/bionic/sysinfo.cpp
@@ -79,11 +79,11 @@
 long get_phys_pages() {
   struct sysinfo si;
   sysinfo(&si);
-  return (si.totalram * si.mem_unit) / sysconf(_SC_PAGE_SIZE);
+  return (static_cast<int64_t>(si.totalram) * si.mem_unit) / PAGE_SIZE;
 }
 
 long get_avphys_pages() {
   struct sysinfo si;
   sysinfo(&si);
-  return ((si.freeram + si.bufferram) * si.mem_unit) / sysconf(_SC_PAGE_SIZE);
+  return ((static_cast<int64_t>(si.freeram) + si.bufferram) * si.mem_unit) / PAGE_SIZE;
 }