Chromium Code Reviews| Index: base/sys_info_posix.cc |
| diff --git a/base/sys_info_posix.cc b/base/sys_info_posix.cc |
| index f480055cc4b472304b51e1c8f5c9d6246b81cbce..72187a6691c5393ed560b49eba9357ec55f55a75 100644 |
| --- a/base/sys_info_posix.cc |
| +++ b/base/sys_info_posix.cc |
| @@ -183,6 +183,24 @@ std::string SysInfo::OperatingSystemVersion() { |
| } |
| #endif |
| +#if !defined(OS_MACOSX) && !defined(OS_ANDROID) |
| +// static |
| +void SysInfo::OperatingSystemVersionNumbers(int32_t* major_version, |
| + int32_t* minor_version, |
| + int32_t* bugfix_version) { |
| + struct utsname info; |
| + *major_version = 0; |
| + *minor_version = 0; |
| + *bugfix_version = 0; |
| + if (uname(&info) < 0) { |
| + NOTREACHED(); |
| + return; |
| + } |
| + sscanf(info.release, "%d.%d.%d", major_version, minor_version, |
|
dcheng
2017/03/21 06:51:17
Is the formatting of |release| guaranteed by some
dcheng
2017/03/21 06:53:37
Also, I'd probably prefer the approach that iOS us
romax
2017/03/21 18:17:33
Tried a search online and didn't find a standard f
|
| + bugfix_version); |
| +} |
| +#endif |
| + |
| // static |
| std::string SysInfo::OperatingSystemArchitecture() { |
| struct utsname info; |