diff options
Diffstat (limited to 'lldb/source/Host/linux')
-rw-r--r-- | lldb/source/Host/linux/Host.cpp | 35 | ||||
-rw-r--r-- | lldb/source/Host/linux/Makefile | 14 |
2 files changed, 49 insertions, 0 deletions
diff --git a/lldb/source/Host/linux/Host.cpp b/lldb/source/Host/linux/Host.cpp new file mode 100644 index 00000000000..b0d43e87de6 --- /dev/null +++ b/lldb/source/Host/linux/Host.cpp @@ -0,0 +1,35 @@ +//===-- source/Host/linux/Host.cpp ------------------------------*- C++ -*-===// +// +// The LLVM Compiler Infrastructure +// +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// + +// C Includes +#include <stdio.h> +#include <sys/utsname.h> + +// C++ Includes +// Other libraries and framework includes +// Project includes +#include "lldb/Host/Host.h" + +using namespace lldb; +using namespace lldb_private; + +bool +Host::GetOSVersion(uint32_t &major, + uint32_t &minor, + uint32_t &update) +{ + struct utsname un; + int status; + + if (uname(&un)) + return false; + + status = sscanf(un.release, "%u.%u.%u", &major, &minor, &update); + return status == 3; +} diff --git a/lldb/source/Host/linux/Makefile b/lldb/source/Host/linux/Makefile new file mode 100644 index 00000000000..bd6d7e4fff8 --- /dev/null +++ b/lldb/source/Host/linux/Makefile @@ -0,0 +1,14 @@ +##===- source/Host/linux/Makefile --------------------------*- Makefile -*-===## +# +# The LLVM Compiler Infrastructure +# +# This file is distributed under the University of Illinois Open Source +# License. See LICENSE.TXT for details. +# +##===----------------------------------------------------------------------===## + +LLDB_LEVEL := ../../.. +LIBRARYNAME := lldbHostLinux +BUILD_ARCHIVE = 1 + +include $(LLDB_LEVEL)/Makefile |