| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "base/sys_info.h" | 5 #include "base/sys_info.h" |
| 6 | 6 |
| 7 #include <errno.h> | 7 #include <errno.h> |
| 8 #include <string.h> | 8 #include <string.h> |
| 9 #include <sys/param.h> | 9 #include <sys/param.h> |
| 10 #include <sys/resource.h> | 10 #include <sys/resource.h> |
| (...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 89 // static | 89 // static |
| 90 int64 SysInfo::AmountOfFreeDiskSpace(const FilePath& path) { | 90 int64 SysInfo::AmountOfFreeDiskSpace(const FilePath& path) { |
| 91 base::ThreadRestrictions::AssertIOAllowed(); | 91 base::ThreadRestrictions::AssertIOAllowed(); |
| 92 | 92 |
| 93 struct statvfs stats; | 93 struct statvfs stats; |
| 94 if (HANDLE_EINTR(statvfs(path.value().c_str(), &stats)) != 0) | 94 if (HANDLE_EINTR(statvfs(path.value().c_str(), &stats)) != 0) |
| 95 return -1; | 95 return -1; |
| 96 return static_cast<int64>(stats.f_bavail) * stats.f_frsize; | 96 return static_cast<int64>(stats.f_bavail) * stats.f_frsize; |
| 97 } | 97 } |
| 98 | 98 |
| 99 bool SysInfo::HasSeekPenalty(const FilePath& path, bool* has_seek_penalty) { |
| 100 return false; |
| 101 } |
| 102 |
| 99 #if !defined(OS_MACOSX) && !defined(OS_ANDROID) | 103 #if !defined(OS_MACOSX) && !defined(OS_ANDROID) |
| 100 // static | 104 // static |
| 101 std::string SysInfo::OperatingSystemName() { | 105 std::string SysInfo::OperatingSystemName() { |
| 102 struct utsname info; | 106 struct utsname info; |
| 103 if (uname(&info) < 0) { | 107 if (uname(&info) < 0) { |
| 104 NOTREACHED(); | 108 NOTREACHED(); |
| 105 return std::string(); | 109 return std::string(); |
| 106 } | 110 } |
| 107 return std::string(info.sysname); | 111 return std::string(info.sysname); |
| 108 } | 112 } |
| (...skipping 26 matching lines...) Expand all Loading... |
| 135 } | 139 } |
| 136 return arch; | 140 return arch; |
| 137 } | 141 } |
| 138 | 142 |
| 139 // static | 143 // static |
| 140 size_t SysInfo::VMAllocationGranularity() { | 144 size_t SysInfo::VMAllocationGranularity() { |
| 141 return getpagesize(); | 145 return getpagesize(); |
| 142 } | 146 } |
| 143 | 147 |
| 144 } // namespace base | 148 } // namespace base |
| OLD | NEW |