summaryrefslogtreecommitdiffstats
path: root/lldb/source/Plugins/Platform
diff options
context:
space:
mode:
Diffstat (limited to 'lldb/source/Plugins/Platform')
-rw-r--r--lldb/source/Plugins/Platform/FreeBSD/PlatformFreeBSD.cpp6
-rw-r--r--lldb/source/Plugins/Platform/Linux/PlatformLinux.cpp9
-rw-r--r--lldb/source/Plugins/Platform/MacOSX/PlatformMacOSX.cpp3
-rw-r--r--lldb/source/Plugins/Platform/gdb-server/PlatformRemoteGDBServer.cpp3
4 files changed, 19 insertions, 2 deletions
diff --git a/lldb/source/Plugins/Platform/FreeBSD/PlatformFreeBSD.cpp b/lldb/source/Plugins/Platform/FreeBSD/PlatformFreeBSD.cpp
index dc0917255d9..cdca4463fff 100644
--- a/lldb/source/Plugins/Platform/FreeBSD/PlatformFreeBSD.cpp
+++ b/lldb/source/Plugins/Platform/FreeBSD/PlatformFreeBSD.cpp
@@ -10,10 +10,13 @@
#include "lldb/lldb-python.h"
#include "PlatformFreeBSD.h"
+#include "lldb/Host/Config.h"
// C Includes
#include <stdio.h>
+#ifndef LLDB_DISABLE_POSIX
#include <sys/utsname.h>
+#endif
// C++ Includes
// Other libraries and framework includes
@@ -636,6 +639,7 @@ PlatformFreeBSD::GetSupportedArchitectureAtIndex (uint32_t idx, ArchSpec &arch)
void
PlatformFreeBSD::GetStatus (Stream &strm)
{
+#ifndef LLDB_DISABLE_POSIX
struct utsname un;
if (uname(&un)) {
@@ -644,5 +648,7 @@ PlatformFreeBSD::GetStatus (Stream &strm)
}
strm << "Host: " << un.sysname << ' ' << un.release << ' ' << un.version << '\n';
+#endif
+
Platform::GetStatus(strm);
}
diff --git a/lldb/source/Plugins/Platform/Linux/PlatformLinux.cpp b/lldb/source/Plugins/Platform/Linux/PlatformLinux.cpp
index 4bf4cf8bc44..1456a7cf714 100644
--- a/lldb/source/Plugins/Platform/Linux/PlatformLinux.cpp
+++ b/lldb/source/Plugins/Platform/Linux/PlatformLinux.cpp
@@ -10,10 +10,13 @@
#include "lldb/lldb-python.h"
#include "PlatformLinux.h"
+#include "lldb/Host/Config.h"
// C Includes
#include <stdio.h>
+#ifndef LLDB_DISABLE_POSIX
#include <sys/utsname.h>
+#endif
// C++ Includes
// Other libraries and framework includes
@@ -357,16 +360,18 @@ PlatformLinux::GetSupportedArchitectureAtIndex (uint32_t idx, ArchSpec &arch)
void
PlatformLinux::GetStatus (Stream &strm)
{
- struct utsname un;
-
Platform::GetStatus(strm);
+#ifndef LLDB_DISABLE_POSIX
+ struct utsname un;
+
if (uname(&un))
return;
strm.Printf (" Kernel: %s\n", un.sysname);
strm.Printf (" Release: %s\n", un.release);
strm.Printf (" Version: %s\n", un.version);
+#endif
}
size_t
diff --git a/lldb/source/Plugins/Platform/MacOSX/PlatformMacOSX.cpp b/lldb/source/Plugins/Platform/MacOSX/PlatformMacOSX.cpp
index 16bcafd97b8..3b0e159e454 100644
--- a/lldb/source/Plugins/Platform/MacOSX/PlatformMacOSX.cpp
+++ b/lldb/source/Plugins/Platform/MacOSX/PlatformMacOSX.cpp
@@ -8,9 +8,12 @@
//===----------------------------------------------------------------------===//
#include "PlatformMacOSX.h"
+#include "lldb/Host/Config.h"
// C Includes
+#ifndef LLDB_DISABLE_POSIX
#include <sys/sysctl.h>
+#endif
// C++ Includes
// Other libraries and framework includes
diff --git a/lldb/source/Plugins/Platform/gdb-server/PlatformRemoteGDBServer.cpp b/lldb/source/Plugins/Platform/gdb-server/PlatformRemoteGDBServer.cpp
index 684d1921e92..5d15db53de7 100644
--- a/lldb/source/Plugins/Platform/gdb-server/PlatformRemoteGDBServer.cpp
+++ b/lldb/source/Plugins/Platform/gdb-server/PlatformRemoteGDBServer.cpp
@@ -10,9 +10,12 @@
#include "lldb/lldb-python.h"
#include "PlatformRemoteGDBServer.h"
+#include "lldb/Host/Config.h"
// C Includes
+#ifndef LLDB_DISABLE_POSIX
#include <sys/sysctl.h>
+#endif
// C++ Includes
// Other libraries and framework includes
OpenPOWER on IntegriCloud