summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohnny Willemsen <jwillemsen@remedy.nl>2008-05-14 12:25:02 +0000
committerJohnny Willemsen <jwillemsen@remedy.nl>2008-05-14 12:25:02 +0000
commitf469f2b724efa7a28551a9e0a46eabd076d944bc (patch)
treee26ba0bd33246ddbd7d1e66e76d10d3577018e24
parenta908d9126d911aa766b2d67e57eb935e43dc6276 (diff)
downloadATCD-f469f2b724efa7a28551a9e0a46eabd076d944bc.tar.gz
Wed May 14 12:24:15 UTC 2008 Johnny Willemsen <jwillemsen@remedy.nl>
-rw-r--r--ACE/ChangeLog24
-rw-r--r--ACE/ace/Makefile.am2
-rw-r--r--ACE/ace/MonitorControl/CPULoadMonitor.h2
-rw-r--r--ACE/ace/MonitorControl/MemoryUsageMonitor.cpp2
-rw-r--r--ACE/ace/MonitorControl/MemoryUsageMonitor.h6
-rw-r--r--ACE/ace/config-linux-common.h2
-rw-r--r--ACE/ace/os_include/os_glob.h2
-rw-r--r--ACE/ace/os_include/os_kstat.h43
-rw-r--r--ACE/ace/os_include/sys/os_statvfs.h2
-rw-r--r--ACE/ace/os_include/sys/os_sysinfo.h39
-rw-r--r--ACE/configure.ac2
11 files changed, 117 insertions, 9 deletions
diff --git a/ACE/ChangeLog b/ACE/ChangeLog
index 3fa6a800b90..e196040de4d 100644
--- a/ACE/ChangeLog
+++ b/ACE/ChangeLog
@@ -1,3 +1,27 @@
+Wed May 14 12:24:15 UTC 2008 Johnny Willemsen <jwillemsen@remedy.nl>
+
+ * ace/os_include/os_kstat.h:
+ * ace/os_include/sys/os_sysinfo.h:
+ New header files
+
+ * ace/os_include/os_glob.h:
+ * ace/os_include/sys/os_statvfs.h:
+ Removed not needed includes
+
+ * configure.ac:
+ Added check for sysinfo.h
+
+ * ace/config-linux-common.h:
+ Added ACE_HAS_SYSINFO and ACE_HAS_SYSINFO_H
+
+ * ace/Makefile.am:
+ Added new files
+
+ * ace/MonitorControl/CPULoadMonitor.h:
+ * ace/MonitorControl/MemoryUsageMonitor.cpp:
+ * ace/MonitorControl/MemoryUsageMonitor.h:
+ Use the new defines and header files
+
Wed May 14 10:41:15 UTC 2008 Johnny Willemsen <jwillemsen@remedy.nl>
* ace/*:
diff --git a/ACE/ace/Makefile.am b/ACE/ace/Makefile.am
index e36f47fe5dc..f622762f36e 100644
--- a/ACE/ace/Makefile.am
+++ b/ACE/ace/Makefile.am
@@ -1161,6 +1161,7 @@ nobase_include_HEADERS += \
os_include/os_intrin.h \
os_include/os_inttypes.h \
os_include/os_iso646.h \
+ os_include/os_kstat.h \
os_include/os_langinfo.h \
os_include/os_libgen.h \
os_include/os_limits.h \
@@ -1218,6 +1219,7 @@ nobase_include_HEADERS += \
os_include/sys/os_stat.h \
os_include/sys/os_statvfs.h \
os_include/sys/os_sysctl.h \
+ os_include/sys/os_sysinfo.h \
os_include/sys/os_time.h \
os_include/sys/os_timeb.h \
os_include/sys/os_times.h \
diff --git a/ACE/ace/MonitorControl/CPULoadMonitor.h b/ACE/ace/MonitorControl/CPULoadMonitor.h
index a748bbbd4df..9f67e22f8d3 100644
--- a/ACE/ace/MonitorControl/CPULoadMonitor.h
+++ b/ACE/ace/MonitorControl/CPULoadMonitor.h
@@ -26,7 +26,7 @@
#if defined (ACE_HAS_WIN32_PDH)
#include "ace/MonitorControl/WindowsMonitor.h"
#elif defined (ACE_HAS_KSTAT)
-#include <kstat.h>
+#include "ace/os_include/os_kstat.h"
#endif
#include "ace/MonitorControl/MonitorControl_export.h"
diff --git a/ACE/ace/MonitorControl/MemoryUsageMonitor.cpp b/ACE/ace/MonitorControl/MemoryUsageMonitor.cpp
index 0a6d378a2fe..a78a48d752d 100644
--- a/ACE/ace/MonitorControl/MemoryUsageMonitor.cpp
+++ b/ACE/ace/MonitorControl/MemoryUsageMonitor.cpp
@@ -34,7 +34,7 @@ namespace ACE
/// Stores value and timestamp with thread-safety.
this->receive (this->value_.doubleValue);
-#elif defined (linux)
+#elif defined (ACE_HAS_SYSINFO)
if (sysinfo (&this->sysinfo_) != 0)
{
ACE_ERROR ((LM_ERROR,
diff --git a/ACE/ace/MonitorControl/MemoryUsageMonitor.h b/ACE/ace/MonitorControl/MemoryUsageMonitor.h
index 777e9493fc1..1918b5fd80c 100644
--- a/ACE/ace/MonitorControl/MemoryUsageMonitor.h
+++ b/ACE/ace/MonitorControl/MemoryUsageMonitor.h
@@ -25,8 +25,8 @@
#if defined (ACE_HAS_WIN32_PDH)
#include "ace/MonitorControl/WindowsMonitor.h"
-#elif defined (linux)
-#include <sys/sysinfo.h>
+#elif defined (ACE_HAS_SYSINFO)
+#include "ace/os_include/sys/os_sysinfo.h"
#endif
#include "ace/MonitorControl/MonitorControl_export.h"
@@ -60,7 +60,7 @@ namespace ACE
private:
static const char* default_name_;
-#if defined (linux)
+#if defined (ACE_HAS_SYSINFO)
struct sysinfo sysinfo_;
#elif defined (ACE_HAS_KSTAT)
#endif
diff --git a/ACE/ace/config-linux-common.h b/ACE/ace/config-linux-common.h
index a72c2e71345..75cbdb11486 100644
--- a/ACE/ace/config-linux-common.h
+++ b/ACE/ace/config-linux-common.h
@@ -258,6 +258,8 @@
// Compiler/platform has <alloca.h>
#define ACE_HAS_ALLOCA_H
+#define ACE_HAS_SYS_SYSINFO_H
+#define ACE_HAS_SYSINFO
// Compiler/platform has the getrusage() system call.
#define ACE_HAS_GETRUSAGE
diff --git a/ACE/ace/os_include/os_glob.h b/ACE/ace/os_include/os_glob.h
index f95019ec34b..12cc197bfbc 100644
--- a/ACE/ace/os_include/os_glob.h
+++ b/ACE/ace/os_include/os_glob.h
@@ -24,8 +24,6 @@
# pragma once
#endif /* ACE_LACKS_PRAGMA_ONCE */
-#include "ace/os_include/sys/os_types.h"
-
#if !defined (ACE_LACKS_GLOB_H)
# include /**/ <glob.h>
#endif /* !ACE_LACKS_GLOB_H */
diff --git a/ACE/ace/os_include/os_kstat.h b/ACE/ace/os_include/os_kstat.h
new file mode 100644
index 00000000000..f89f79332d6
--- /dev/null
+++ b/ACE/ace/os_include/os_kstat.h
@@ -0,0 +1,43 @@
+// -*- C++ -*-
+
+//=============================================================================
+/**
+ * @file os_kstat.h
+ *
+ * $Id$
+ *
+ * @author Johnny Willemsen <jwillemsen@remedy.nl>
+ */
+//=============================================================================
+
+#ifndef ACE_OS_INCLUDE_OS_KSTAT_H
+#define ACE_OS_INCLUDE_OS_KSTAT_H
+
+#include /**/ "ace/pre.h"
+
+#include /**/ "ace/config-all.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#if defined (ACE_HAS_KSTAT)
+# define ACE_HAS_KSTAT_H
+#endif /* ACE_HAS_KSTAT */
+
+#if defined (ACE_HAS_KSTAT_H)
+# include <kstat.h>
+#endif /* ACE_HAS_KSTAT_H */
+
+// Place all additions (especially function declarations) within extern "C" {}
+#ifdef __cplusplus
+extern "C"
+{
+#endif /* __cplusplus */
+
+#ifdef __cplusplus
+}
+#endif /* __cplusplus */
+
+#include /**/ "ace/post.h"
+#endif /* ACE_OS_INCLUDE_OS_KSTAT_H */
diff --git a/ACE/ace/os_include/sys/os_statvfs.h b/ACE/ace/os_include/sys/os_statvfs.h
index 546c20b10f2..32f363dfb54 100644
--- a/ACE/ace/os_include/sys/os_statvfs.h
+++ b/ACE/ace/os_include/sys/os_statvfs.h
@@ -24,8 +24,6 @@
# pragma once
#endif /* ACE_LACKS_PRAGMA_ONCE */
-#include "ace/os_include/sys/os_types.h"
-
#if !defined (ACE_LACKS_SYS_STATVFS_H)
# include /**/ <sys/statvfs.h>
#endif /* !ACE_LACKS_SYS_STATVFS_H */
diff --git a/ACE/ace/os_include/sys/os_sysinfo.h b/ACE/ace/os_include/sys/os_sysinfo.h
new file mode 100644
index 00000000000..9537c9c615a
--- /dev/null
+++ b/ACE/ace/os_include/sys/os_sysinfo.h
@@ -0,0 +1,39 @@
+// -*- C++ -*-
+
+//=============================================================================
+/**
+ * @file os_sysinfo.h
+ *
+ * $Id$
+ *
+ * @author Johnny Willemsen <jwillemsen@remedy.nl>
+ */
+//=============================================================================
+
+#ifndef ACE_OS_INCLUDE_SYS_OS_SYSINFO_H
+#define ACE_OS_INCLUDE_SYS_OS_SYSINFO_H
+
+#include /**/ "ace/pre.h"
+
+#include "ace/config-lite.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#if defined (ACE_HAS_SYS_SYSINFO_H)
+# include /**/ <sys/sysinfo.h>
+#endif /* ACE_HAS_SYS_SYSINFO_H */
+
+// Place all additions (especially function declarations) within extern "C" {}
+#ifdef __cplusplus
+extern "C"
+{
+#endif /* __cplusplus */
+
+#ifdef __cplusplus
+}
+#endif /* __cplusplus */
+
+#include /**/ "ace/post.h"
+#endif /* ACE_OS_INCLUDE_SYS_OS_SYSINFO_H */
diff --git a/ACE/configure.ac b/ACE/configure.ac
index 2d07d17315a..dcb259a119e 100644
--- a/ACE/configure.ac
+++ b/ACE/configure.ac
@@ -684,6 +684,8 @@ ACE_CHECK_LACKS_HEADERS(sys/sysctl.h, [], [],
#endif
])
+ACE_CHECK_HAS_HEADERS(sys/sysinfo.h)
+
ACE_CHECK_LACKS_HEADERS(sys/time.h)
ACE_CHECK_LACKS_HEADERS(sys/uio.h)