1 //===-- source/Host/linux/Host.cpp ------------------------------*- C++ -*-===// 2 // 3 // The LLVM Compiler Infrastructure 4 // 5 // This file is distributed under the University of Illinois Open Source 6 // License. See LICENSE.TXT for details. 7 // 8 //===----------------------------------------------------------------------===// 9 10 // C Includes 11 #include <stdio.h> 12 #include <sys/utsname.h> 13 14 // C++ Includes 15 // Other libraries and framework includes 16 // Project includes 17 #include "lldb/Host/Host.h" 18 19 using namespace lldb; 20 using namespace lldb_private; 21 22 bool 23 Host::GetOSVersion(uint32_t &major, 24 uint32_t &minor, 25 uint32_t &update) 26 { 27 struct utsname un; 28 int status; 29 30 if (uname(&un)) 31 return false; 32 33 status = sscanf(un.release, "%u.%u.%u", &major, &minor, &update); 34 return status == 3; 35 } 36