openbsd-ports/www/chromium/patches/patch-base_sys_info_posix_cc

22 lines
694 B
Plaintext
Raw Normal View History

$OpenBSD: patch-base_sys_info_posix_cc,v 1.2 2013/04/03 08:19:10 robert Exp $
--- base/sys_info_posix.cc.orig.port Fri Mar 22 02:13:43 2013
+++ base/sys_info_posix.cc Tue Apr 2 21:05:17 2013
2013-01-18 16:38:02 -05:00
@@ -40,6 +40,17 @@ int SysInfo::NumberOfProcessors() {
#endif
// static
+int64 SysInfo::AmountOfAvailablePhysicalMemory() {
+ long available_pages = sysconf(_SC_AVPHYS_PAGES);
+ long page_size = sysconf(_SC_PAGE_SIZE);
+ if (available_pages == -1 || page_size == -1) {
+ NOTREACHED();
+ return 0;
+ }
+ return static_cast<int64>(available_pages) * page_size;
+}
+
+// static
int64 SysInfo::AmountOfFreeDiskSpace(const FilePath& path) {
base::ThreadRestrictions::AssertIOAllowed();