summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorolli <olli@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>2009-10-17 20:06:21 +0000
committerolli <olli@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>2009-10-17 20:06:21 +0000
commitf7fca5cd08e6dd0cd3b680086831e7eb733b81ed (patch)
treeefb44790cf1670d4a7dfa6277e3a0dba8a2ef308
parent16e1ef2ed61efc1efa4c62c833aeabb21364eccb (diff)
downloadATCD-f7fca5cd08e6dd0cd3b680086831e7eb733b81ed.tar.gz
ChangeLogTag: Sat Oct 17 19:58:52 UTC 2009 Olli Savia <ops@iki.fi>
-rw-r--r--ACE/ChangeLog25
-rw-r--r--ACE/ace/OS_NS_string.cpp12
-rw-r--r--ACE/ace/OS_NS_string.h9
-rw-r--r--ACE/ace/README23
-rw-r--r--ACE/ace/config-cray.h2
-rw-r--r--ACE/ace/config-cygwin32.h2
-rw-r--r--ACE/ace/config-freebsd.h1
-rw-r--r--ACE/ace/config-lynxos.h1
-rw-r--r--ACE/ace/config-netbsd.h1
-rw-r--r--ACE/ace/config-openbsd.h1
-rw-r--r--ACE/ace/config-sunos5.4-g++.h1
-rw-r--r--ACE/ace/config-sunos5.4-sunc++-4.x.h1
-rw-r--r--ACE/ace/config-sunos5.5.h1
-rw-r--r--ACE/ace/config-win32-common.h3
-rw-r--r--ACE/tests/OS_Test.cpp31
15 files changed, 86 insertions, 28 deletions
diff --git a/ACE/ChangeLog b/ACE/ChangeLog
index 5a558187a63..e827a796b61 100644
--- a/ACE/ChangeLog
+++ b/ACE/ChangeLog
@@ -1,3 +1,28 @@
+Sat Oct 17 19:58:52 UTC 2009 Olli Savia <ops@iki.fi>
+
+ * ace/OS_NS_string.h:
+ * ace/OS_NS_string.cpp:
+ Added ACE_OS::strsignal().
+
+ * ace/config-cygwin32.h:
+ * ace/config-freebsd.h:
+ * ace/config-lynxos.h:
+ * ace/config-netbsd.h:
+ * ace/config-openbsd.h:
+ * ace/config-sunos5.4-g++.h:
+ * ace/config-sunos5.4-sunc++-4.x.h:
+ * ace/config-sunos5.5.h:
+ Added ACE_HAS_STRSIGNAL
+
+ * tests/OS_Test.cpp:
+ Added a test for ACE_OS::strsignal().
+
+ * ace/config-win32-common.h:
+ * ace/README:
+ * ace/config-cray.h:
+ Removed references to ACE_HAS_SYS_SIGLIST. It will be removed
+ soon.
+
Sat Oct 17 10:29:13 UTC 2009 Olli Savia <ops@iki.fi>
* ace/config-lynxos.h:
diff --git a/ACE/ace/OS_NS_string.cpp b/ACE/ace/OS_NS_string.cpp
index 6ecb89b860a..19831bc20ed 100644
--- a/ACE/ace/OS_NS_string.cpp
+++ b/ACE/ace/OS_NS_string.cpp
@@ -156,6 +156,18 @@ ACE_OS::strerror_emulation (int)
}
#endif /* ACE_LACKS_STRERROR */
+char *
+ACE_OS::strsignal (int sig)
+{
+#if defined (ACE_HAS_STRSIGNAL)
+ return ACE_STD_NAMESPACE::strsignal (sig);
+#else
+ static char signal_text[128];
+ ACE_OS::sprintf (signal_text, "Unknown signal: %d", sig);
+ return signal_text;
+#endif
+}
+
const char *
ACE_OS::strnchr (const char *s, int c, size_t len)
{
diff --git a/ACE/ace/OS_NS_string.h b/ACE/ace/OS_NS_string.h
index 0c5214c06de..77d48d8dc72 100644
--- a/ACE/ace/OS_NS_string.h
+++ b/ACE/ace/OS_NS_string.h
@@ -197,6 +197,15 @@ namespace ACE_OS {
char *strerror_emulation (int errnum);
#endif /* ACE_LACKS_STRERROR */
+ /*
+ ** Returns a string describing the signal number passed in the
+ ** argument signum. If the supplied signal number is out of range,
+ ** a string of the form "Unknown signal %d" is used to format the string
+ ** whose pointer is returned and errno is set to EINVAL.
+ */
+ extern ACE_Export
+ char *strsignal (int signum);
+
/// Finds the length of a string (char version).
ACE_NAMESPACE_INLINE_FUNCTION
size_t strlen (const char *s);
diff --git a/ACE/ace/README b/ACE/ace/README
index 94f1e27e735..8494402fff3 100644
--- a/ACE/ace/README
+++ b/ACE/ace/README
@@ -646,8 +646,6 @@ ACE_HAS_SYS_LOADAVG_H Compiler/platform contains the
<sys/loadavg.h> file.
ACE_HAS_SYS_PSTAT_H Compiler/platform contains the
<sys/pstat.h> file.
-ACE_HAS_SYS_SIGLIST Compiler/platform supports
- _sys_siglist array
ACE_HAS_SYS_SOCKIO_H Compiler/platform provides the
sockio.h file
ACE_HAS_SYS_SYSCALL_H Compiler/platform contains the
@@ -1708,27 +1706,6 @@ ACE_HAS_SYS_FILIO_H:
use #ifdef HP-UX to modify sysincludes.h
-ACE_HAS_SYS_SIGLIST:
---------------------
-
- Used in:
- ace/OS.h
- libsrc/Log_Msg/Log_Msg.C
-
- Notes:
- if not defined, does a:
- extern const char **_sys_siglist;
-
- Solaris:
- This is an array holding signal descriptions.
-
- HPUX:
- don't set.
- Some additional work is required. In libsrc/Log_Msg/Log_Msg.C,
- sys_siglist is used regardless of ACE_HAS_SYS_SIGLIST.
- have to add #ifdefs to remove them.
-
-
ACE_HAS_TEMPLATE_TYPEDEFS:
--------------------------
diff --git a/ACE/ace/config-cray.h b/ACE/ace/config-cray.h
index 594b7ab265b..20d231622c2 100644
--- a/ACE/ace/config-cray.h
+++ b/ACE/ace/config-cray.h
@@ -189,8 +189,6 @@
// Ones to check out at some point
-/* #define ACE_HAS_SYS_SIGLIST */
-
// C++ Compiler stuff to verify
/* #define ACE_NEW_THROWS_EXCEPTIONS */
/* #define ACE_HAS_TEMPLATE_TYPEDEFS */
diff --git a/ACE/ace/config-cygwin32.h b/ACE/ace/config-cygwin32.h
index 460a90c57bb..31202e57a2f 100644
--- a/ACE/ace/config-cygwin32.h
+++ b/ACE/ace/config-cygwin32.h
@@ -115,6 +115,8 @@
// Compiler/platform supports strerror ().
#define ACE_HAS_STRERROR
+#define ACE_HAS_STRSIGNAL
+
// Compiler supports the ssize_t typedef.
#define ACE_HAS_SSIZE_T
diff --git a/ACE/ace/config-freebsd.h b/ACE/ace/config-freebsd.h
index 7ae302c1371..69c408168ef 100644
--- a/ACE/ace/config-freebsd.h
+++ b/ACE/ace/config-freebsd.h
@@ -84,6 +84,7 @@
#define ACE_HAS_SYSV_IPC
#define ACE_HAS_SYS_FILIO_H
#define ACE_HAS_SYS_SIGLIST
+#define ACE_HAS_STRSIGNAL
#define ACE_HAS_SYS_SOCKIO_H
#define ACE_HAS_SYS_SYSCALL_H
#define ACE_HAS_TERMIOS
diff --git a/ACE/ace/config-lynxos.h b/ACE/ace/config-lynxos.h
index e22a3fa6a77..8460f9eabe2 100644
--- a/ACE/ace/config-lynxos.h
+++ b/ACE/ace/config-lynxos.h
@@ -91,6 +91,7 @@
#define ACE_HAS_SYS_ERRLIST
#define ACE_HAS_SYS_FILIO_H
#define ACE_HAS_SYS_SIGLIST
+#define ACE_HAS_STRSIGNAL
#define ACE_HAS_SYS_SOCKIO_H
#define ACE_HAS_TERMIOS
#define ACE_HAS_TIMEZONE_GETTIMEOFDAY
diff --git a/ACE/ace/config-netbsd.h b/ACE/ace/config-netbsd.h
index 999b66ce5e5..0b526e3dbe6 100644
--- a/ACE/ace/config-netbsd.h
+++ b/ACE/ace/config-netbsd.h
@@ -80,6 +80,7 @@
#define ACE_HAS_SYS_ERRLIST 1
#define ACE_HAS_SYS_FILIO_H 1
#define ACE_HAS_SYS_SIGLIST 1
+#define ACE_HAS_STRSIGNAL
#define ACE_HAS_SYS_SOCKIO_H 1
#define ACE_HAS_SYS_SYSCALL_H 1
#define ACE_HAS_SYSCTL
diff --git a/ACE/ace/config-openbsd.h b/ACE/ace/config-openbsd.h
index 14be6cc99f8..c8b34a363ed 100644
--- a/ACE/ace/config-openbsd.h
+++ b/ACE/ace/config-openbsd.h
@@ -128,6 +128,7 @@
#define ACE_HAS_SYS_ERRLIST
#define ACE_HAS_SYS_FILIO_H
#define ACE_HAS_SYS_SIGLIST
+#define ACE_HAS_STRSIGNAL
#define ACE_HAS_SYS_SOCKIO_H
#define ACE_HAS_SYS_SYSCALL_H
#define ACE_HAS_TERMIOS
diff --git a/ACE/ace/config-sunos5.4-g++.h b/ACE/ace/config-sunos5.4-g++.h
index 5d19e14e798..f94557c2ac5 100644
--- a/ACE/ace/config-sunos5.4-g++.h
+++ b/ACE/ace/config-sunos5.4-g++.h
@@ -129,6 +129,7 @@
// Compiler/platform supports sys_siglist array.
#define ACE_HAS_SYS_SIGLIST
+#define ACE_HAS_STRSIGNAL
/* Turn off the following defines if you want to disable threading. */
// Compile using multi-thread libraries.
diff --git a/ACE/ace/config-sunos5.4-sunc++-4.x.h b/ACE/ace/config-sunos5.4-sunc++-4.x.h
index bbf9816e616..f2642d47611 100644
--- a/ACE/ace/config-sunos5.4-sunc++-4.x.h
+++ b/ACE/ace/config-sunos5.4-sunc++-4.x.h
@@ -126,6 +126,7 @@
// Compiler/platform supports sys_siglist array.
#define ACE_HAS_SYS_SIGLIST
+#define ACE_HAS_STRSIGNAL
/* Turn off the following defines if you want to disable threading. */
// Compile using multi-thread libraries.
diff --git a/ACE/ace/config-sunos5.5.h b/ACE/ace/config-sunos5.5.h
index 9fd68049d50..b93395ac4f3 100644
--- a/ACE/ace/config-sunos5.5.h
+++ b/ACE/ace/config-sunos5.5.h
@@ -298,6 +298,7 @@
// Compiler/platform supports sys_siglist array.
#define ACE_HAS_SYS_SIGLIST
+#define ACE_HAS_STRSIGNAL
// SunOS 5.5.x does not support mkstemp
#define ACE_LACKS_MKSTEMP
diff --git a/ACE/ace/config-win32-common.h b/ACE/ace/config-win32-common.h
index 7955a24b994..81f24c9da62 100644
--- a/ACE/ace/config-win32-common.h
+++ b/ACE/ace/config-win32-common.h
@@ -347,9 +347,6 @@
// Platform provides <sys/filio.h> header.
//define ACE_HAS_SYS_FILIO_H
-// Compiler/platform supports sys_siglist array.
-//define ACE_HAS_SYS_SIGLIST
-
// Platform supports ACE_TLI timod STREAMS module.
//define ACE_HAS_TIMOD_H
diff --git a/ACE/tests/OS_Test.cpp b/ACE/tests/OS_Test.cpp
index 4f0fb95090d..940b84b7a8f 100644
--- a/ACE/tests/OS_Test.cpp
+++ b/ACE/tests/OS_Test.cpp
@@ -938,6 +938,34 @@ string_convert_test (void)
#endif /* ACE_HAS_WCHAR */
}
+// Test ACE_OS::strsignal()
+int
+strsignal_test (void)
+{
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("Testing strsignal method\n")));
+
+ int test_status = 0;
+
+ const char* result = 0;
+
+ for (int i=0; i < (ACE_NSIG + 1); ++i)
+ {
+ result = ACE_OS::strsignal (i);
+ if (result == 0)
+ {
+ ACE_ERROR ((LM_ERROR, ACE_TEXT ("strsignal returned null\n")));
+ test_status = 1;
+ }
+ else
+ {
+ ACE_DEBUG ((LM_DEBUG, ACE_TEXT (" Sig #%d: %s\n"), i, result));
+ }
+ }
+
+ return test_status;
+}
+
// Test the methods for getting cpu info
int
cpu_info_test (void)
@@ -1240,6 +1268,9 @@ run_main (int, ACE_TCHAR *[])
if ((result = string_strsncpy_test ()) != 0)
status = result;
+ if ((result = strsignal_test ()) != 0)
+ status = result;
+
if ((result = cpu_info_test ()) != 0)
status = result;