Author: faridz
Date: Wed Aug 8 12:59:59 2007
New Revision: 564007
URL: http://svn.apache.org/viewvc?view=rev&rev=564007
Log:
2007-08-08 Farid Zaripov <[EMAIL PROTECTED]>
* cmdopt.cpp [_WIN32]: Set TICKS_PER_SEC = CLOCKS_PER_SEC.
* exec.cpp [_WIN32]: Added mappings of the STATUS_STACK_BUFFER_OVERRUN.
Translate wall time value from 100ns units to clocks.
Modified:
incubator/stdcxx/trunk/util/cmdopt.cpp
incubator/stdcxx/trunk/util/exec.cpp
Modified: incubator/stdcxx/trunk/util/cmdopt.cpp
URL:
http://svn.apache.org/viewvc/incubator/stdcxx/trunk/util/cmdopt.cpp?view=diff&rev=564007&r1=564006&r2=564007
==============================================================================
--- incubator/stdcxx/trunk/util/cmdopt.cpp (original)
+++ incubator/stdcxx/trunk/util/cmdopt.cpp Wed Aug 8 12:59:59 2007
@@ -72,7 +72,7 @@
const char default_path_sep = '\\';
const char suffix_sep = '.';
const size_t exe_suffix_len = 4; /* strlen(".exe") == 4 */
-const float TICKS_PER_SEC = 10000000; /* 100 nanosecond units in a second */
+const float TICKS_PER_SEC = CLOCKS_PER_SEC;
# ifndef _WIN32_WINNT
# define _WIN32_WINNT 0x0500
Modified: incubator/stdcxx/trunk/util/exec.cpp
URL:
http://svn.apache.org/viewvc/incubator/stdcxx/trunk/util/exec.cpp?view=diff&rev=564007&r1=564006&r2=564007
==============================================================================
--- incubator/stdcxx/trunk/util/exec.cpp (original)
+++ incubator/stdcxx/trunk/util/exec.cpp Wed Aug 8 12:59:59 2007
@@ -59,7 +59,10 @@
# define SIGSYS 12 // STATUS_INVALID_PARAMETER translated into SIGSYS
# endif
# ifndef STATUS_INVALID_PARAMETER
-# define STATUS_INVALID_PARAMETER ((DWORD)0xC000000DL)
+# define STATUS_INVALID_PARAMETER ((DWORD)0xC000000DL)
+# endif
+# ifndef STATUS_STACK_BUFFER_OVERRUN
+# define STATUS_STACK_BUFFER_OVERRUN ((DWORD)0xC0000409L)
# endif
#endif
#include <sys/stat.h> /* for S_* */
@@ -869,6 +872,7 @@
{ STATUS_BREAKPOINT, SIGTRAP },
{ STATUS_ACCESS_VIOLATION, SIGSEGV },
{ STATUS_STACK_OVERFLOW, SIGSEGV },
+ { STATUS_STACK_BUFFER_OVERRUN, SIGSEGV },
{ STATUS_IN_PAGE_ERROR, SIGBUS },
{ STATUS_ILLEGAL_INSTRUCTION, SIGILL },
{ STATUS_PRIVILEGED_INSTRUCTION, SIGILL },
@@ -1156,9 +1160,14 @@
/* Calculate wall clock time elapsed while the process ran */
GetSystemTimeAsFileTime(&end);
+ /* 100 nanosecond units in a second */
+ const DWORD UNITS_PER_SEC = 10000000;
+ const DWORD UNITS_PER_CLOCK = UNITS_PER_SEC / CLOCKS_PER_SEC;
+ assert (UNITS_PER_CLOCK * CLOCKS_PER_SEC == UNITS_PER_SEC);
+
/* We're ignoring dwHighDateTime, as it's outside the percision of clock_t
*/
- wall = end.dwLowDateTime - start.dwLowDateTime;
+ wall = (end.dwLowDateTime - start.dwLowDateTime) / UNITS_PER_CLOCK;
/* Link the delta */
result->wall = &wall;