You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by rj...@apache.org on 2013/01/28 11:55:45 UTC
svn commit: r1439337 - /tomcat/native/trunk/native/os/unix/system.c
Author: rjung
Date: Mon Jan 28 10:55:45 2013
New Revision: 1439337
URL: http://svn.apache.org/viewvc?rev=1439337&view=rev
Log:
Docs in OS.java tell us we want microseconds.
Linux impl already provides microsecs, so lets
switch Solaris impl also to micro instead of milli.
Modified:
tomcat/native/trunk/native/os/unix/system.c
Modified: tomcat/native/trunk/native/os/unix/system.c
URL: http://svn.apache.org/viewvc/tomcat/native/trunk/native/os/unix/system.c?rev=1439337&r1=1439336&r2=1439337&view=diff
==============================================================================
--- tomcat/native/trunk/native/os/unix/system.c (original)
+++ tomcat/native/trunk/native/os/unix/system.c Mon Jan 28 10:55:45 2013
@@ -210,8 +210,8 @@ TCN_IMPLEMENT_CALL(jint, OS, info)(TCN_S
int res = 0; /* general result state */
/* non-static variables - sysinfo/swapctl use */
long ret_sysconf; /* value returned from sysconf call */
- long tck_dividend; /* factor used by transforming tick numbers to milliseconds */
- long tck_divisor; /* divisor used by transforming tick numbers to milliseconds */
+ long tck_dividend; /* factor used by transforming tick numbers to microseconds */
+ long tck_divisor; /* divisor used by transforming tick numbers to microseconds */
long sys_pagesize = sysconf(_SC_PAGESIZE); /* size of a system memory page in bytes */
long sys_clk_tck = sysconf(_SC_CLK_TCK); /* number of system ticks per second */
struct anoninfo info; /* structure for information about sizes in anonymous memory system */
@@ -283,11 +283,11 @@ TCN_IMPLEMENT_CALL(jint, OS, info)(TCN_S
creation = (long)(now - (prusg.pr_tstamp.tv_sec -
prusg.pr_create.tv_sec));
}
- pvals[10] = (jlong)(creation);
- pvals[11] = (jlong)((jlong)prusg.pr_stime.tv_sec * 1000 +
- (prusg.pr_stime.tv_nsec / 1000000));
- pvals[12] = (jlong)((jlong)prusg.pr_utime.tv_sec * 1000 +
- (prusg.pr_utime.tv_nsec / 1000000));
+ pvals[10] = (jlong)(creation * 1000000L);
+ pvals[11] = (jlong)((jlong)prusg.pr_stime.tv_sec * 1000000L +
+ (prusg.pr_stime.tv_nsec / 1000L));
+ pvals[12] = (jlong)((jlong)prusg.pr_utime.tv_sec * 1000000L +
+ (prusg.pr_utime.tv_nsec / 1000L));
pvals[15] = (jlong)(prusg.pr_majf);
}
else {
@@ -299,7 +299,7 @@ TCN_IMPLEMENT_CALL(jint, OS, info)(TCN_S
rv = apr_get_os_error();
}
else {
- tck_dividend = 1000;
+ tck_dividend = 1000000L;
tck_divisor = sys_clk_tck;
for (i = 0; i < 3; i++) {
if (tck_divisor % 2 == 0) {
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org