Mercurial > hg > graal-jvmci-8
comparison src/os/linux/vm/os_linux.cpp @ 513:2328d1d3f8cf
6781583: Hotspot build fails on linux 64 bit platform with gcc 4.3.2
Summary: Fixed the wrong cast between types since more restrictions are imposed by gcc 4.3.2
Reviewed-by: jcoomes, acorn, phh, never
author | xlu |
---|---|
date | Wed, 24 Dec 2008 19:13:53 -0800 |
parents | 24fda36852ce |
children | fc7ab6287598 |
comparison
equal
deleted
inserted
replaced
512:db4caa99ef11 | 513:2328d1d3f8cf |
---|---|
1158 // Skip blank chars | 1158 // Skip blank chars |
1159 do s++; while (isspace(*s)); | 1159 do s++; while (isspace(*s)); |
1160 | 1160 |
1161 /* 1 1 1 1 1 1 1 1 1 1 2 2 2 2 2 2 2 2 2 */ | 1161 /* 1 1 1 1 1 1 1 1 1 1 2 2 2 2 2 2 2 2 2 */ |
1162 /* 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 */ | 1162 /* 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 */ |
1163 i = sscanf(s, "%c %d %d %d %d %d %lu %lu %lu %lu %lu %lu %lu %ld %ld %ld %ld %ld %ld %lu %lu %ld %lu %lu %lu %lu", | 1163 i = sscanf(s, "%c %d %d %d %d %d %lu %lu %lu %lu %lu %lu %lu %ld %ld %ld %ld %ld %ld " |
1164 UINTX_FORMAT UINTX_FORMAT UINTX_FORMAT | |
1165 " %lu " | |
1166 UINTX_FORMAT UINTX_FORMAT UINTX_FORMAT, | |
1164 &state, /* 3 %c */ | 1167 &state, /* 3 %c */ |
1165 &ppid, /* 4 %d */ | 1168 &ppid, /* 4 %d */ |
1166 &pgrp, /* 5 %d */ | 1169 &pgrp, /* 5 %d */ |
1167 &session, /* 6 %d */ | 1170 &session, /* 6 %d */ |
1168 &nr, /* 7 %d */ | 1171 &nr, /* 7 %d */ |
1178 &cstime, /* 17 %ld */ | 1181 &cstime, /* 17 %ld */ |
1179 &prio, /* 18 %ld */ | 1182 &prio, /* 18 %ld */ |
1180 &nice, /* 19 %ld */ | 1183 &nice, /* 19 %ld */ |
1181 &junk, /* 20 %ld */ | 1184 &junk, /* 20 %ld */ |
1182 &it_real, /* 21 %ld */ | 1185 &it_real, /* 21 %ld */ |
1183 &start, /* 22 %lu */ | 1186 &start, /* 22 UINTX_FORMAT */ |
1184 &vsize, /* 23 %lu */ | 1187 &vsize, /* 23 UINTX_FORMAT */ |
1185 &rss, /* 24 %ld */ | 1188 &rss, /* 24 UINTX_FORMAT */ |
1186 &rsslim, /* 25 %lu */ | 1189 &rsslim, /* 25 %lu */ |
1187 &scodes, /* 26 %lu */ | 1190 &scodes, /* 26 UINTX_FORMAT */ |
1188 &ecode, /* 27 %lu */ | 1191 &ecode, /* 27 UINTX_FORMAT */ |
1189 &stack_start); /* 28 %lu */ | 1192 &stack_start); /* 28 UINTX_FORMAT */ |
1190 } | 1193 } |
1191 | 1194 |
1192 if (i != 28 - 2) { | 1195 if (i != 28 - 2) { |
1193 assert(false, "Bad conversion from /proc/self/stat"); | 1196 assert(false, "Bad conversion from /proc/self/stat"); |
1194 // product mode - assume we are the initial thread, good luck in the | 1197 // product mode - assume we are the initial thread, good luck in the |
2022 char dli_fname[MAXPATHLEN]; | 2025 char dli_fname[MAXPATHLEN]; |
2023 bool ret = dll_address_to_library_name( | 2026 bool ret = dll_address_to_library_name( |
2024 CAST_FROM_FN_PTR(address, os::jvm_path), | 2027 CAST_FROM_FN_PTR(address, os::jvm_path), |
2025 dli_fname, sizeof(dli_fname), NULL); | 2028 dli_fname, sizeof(dli_fname), NULL); |
2026 assert(ret != 0, "cannot locate libjvm"); | 2029 assert(ret != 0, "cannot locate libjvm"); |
2027 realpath(dli_fname, buf); | 2030 if (realpath(dli_fname, buf) == NULL) |
2031 return; | |
2028 | 2032 |
2029 if (strcmp(Arguments::sun_java_launcher(), "gamma") == 0) { | 2033 if (strcmp(Arguments::sun_java_launcher(), "gamma") == 0) { |
2030 // Support for the gamma launcher. Typical value for buf is | 2034 // Support for the gamma launcher. Typical value for buf is |
2031 // "<JAVA_HOME>/jre/lib/<arch>/<vmtype>/libjvm.so". If "/jre/lib/" appears at | 2035 // "<JAVA_HOME>/jre/lib/<arch>/<vmtype>/libjvm.so". If "/jre/lib/" appears at |
2032 // the right place in the string, then assume we are installed in a JDK and | 2036 // the right place in the string, then assume we are installed in a JDK and |
2046 // Check the current module name "libjvm.so" or "libjvm_g.so". | 2050 // Check the current module name "libjvm.so" or "libjvm_g.so". |
2047 p = strrchr(buf, '/'); | 2051 p = strrchr(buf, '/'); |
2048 assert(strstr(p, "/libjvm") == p, "invalid library name"); | 2052 assert(strstr(p, "/libjvm") == p, "invalid library name"); |
2049 p = strstr(p, "_g") ? "_g" : ""; | 2053 p = strstr(p, "_g") ? "_g" : ""; |
2050 | 2054 |
2051 realpath(java_home_var, buf); | 2055 if (realpath(java_home_var, buf) == NULL) |
2056 return; | |
2052 sprintf(buf + strlen(buf), "/jre/lib/%s", cpu_arch); | 2057 sprintf(buf + strlen(buf), "/jre/lib/%s", cpu_arch); |
2053 if (0 == access(buf, F_OK)) { | 2058 if (0 == access(buf, F_OK)) { |
2054 // Use current module name "libjvm[_g].so" instead of | 2059 // Use current module name "libjvm[_g].so" instead of |
2055 // "libjvm"debug_only("_g")".so" since for fastdebug version | 2060 // "libjvm"debug_only("_g")".so" since for fastdebug version |
2056 // we should have "libjvm.so" but debug_only("_g") adds "_g"! | 2061 // we should have "libjvm.so" but debug_only("_g") adds "_g"! |
2057 // It is used when we are choosing the HPI library's name | 2062 // It is used when we are choosing the HPI library's name |
2058 // "libhpi[_g].so" in hpi::initialize_get_interface(). | 2063 // "libhpi[_g].so" in hpi::initialize_get_interface(). |
2059 sprintf(buf + strlen(buf), "/hotspot/libjvm%s.so", p); | 2064 sprintf(buf + strlen(buf), "/hotspot/libjvm%s.so", p); |
2060 } else { | 2065 } else { |
2061 // Go back to path of .so | 2066 // Go back to path of .so |
2062 realpath(dli_fname, buf); | 2067 if (realpath(dli_fname, buf) == NULL) |
2068 return; | |
2063 } | 2069 } |
2064 } | 2070 } |
2065 } | 2071 } |
2066 } | 2072 } |
2067 | 2073 |
4182 if (s == NULL ) return -1; | 4188 if (s == NULL ) return -1; |
4183 | 4189 |
4184 // Skip blank chars | 4190 // Skip blank chars |
4185 do s++; while (isspace(*s)); | 4191 do s++; while (isspace(*s)); |
4186 | 4192 |
4187 count = sscanf(s,"%c %d %d %d %d %d %lu %lu %lu %lu %lu %lu %lu", | 4193 count = sscanf(s,"%*c %d %d %d %d %d %lu %lu %lu %lu %lu %lu %lu", |
4188 &idummy, &idummy, &idummy, &idummy, &idummy, &idummy, | 4194 &idummy, &idummy, &idummy, &idummy, &idummy, |
4189 &ldummy, &ldummy, &ldummy, &ldummy, &ldummy, | 4195 &ldummy, &ldummy, &ldummy, &ldummy, &ldummy, |
4190 &user_time, &sys_time); | 4196 &user_time, &sys_time); |
4191 if ( count != 13 ) return -1; | 4197 if ( count != 12 ) return -1; |
4192 if (user_sys_cpu_time) { | 4198 if (user_sys_cpu_time) { |
4193 return ((jlong)sys_time + (jlong)user_time) * (1000000000 / clock_tics_per_sec); | 4199 return ((jlong)sys_time + (jlong)user_time) * (1000000000 / clock_tics_per_sec); |
4194 } else { | 4200 } else { |
4195 return (jlong)user_time * (1000000000 / clock_tics_per_sec); | 4201 return (jlong)user_time * (1000000000 / clock_tics_per_sec); |
4196 } | 4202 } |