src/solaris/native/sun/management/OperatingSystemImpl.c

Print this page

        

*** 26,36 **** #include "jni.h" #include "jni_util.h" #include "jlong.h" #include "jvm.h" #include "management.h" ! #include "com_sun_management_UnixOperatingSystem.h" #include <sys/types.h> #include <sys/stat.h> #if defined(_ALLBSD_SOURCE) #include <sys/sysctl.h> --- 26,36 ---- #include "jni.h" #include "jni_util.h" #include "jlong.h" #include "jvm.h" #include "management.h" ! #include "sun_management_OperatingSystemImpl.h" #include <sys/types.h> #include <sys/stat.h> #if defined(_ALLBSD_SOURCE) #include <sys/sysctl.h>
*** 173,190 **** return (0); #endif } JNIEXPORT void JNICALL ! Java_com_sun_management_UnixOperatingSystem_initialize (JNIEnv *env, jclass cls) { page_size = sysconf(_SC_PAGESIZE); } JNIEXPORT jlong JNICALL ! Java_com_sun_management_UnixOperatingSystem_getCommittedVirtualMemorySize (JNIEnv *env, jobject mbean) { #ifdef __solaris__ psinfo_t psinfo; ssize_t result; --- 173,190 ---- return (0); #endif } JNIEXPORT void JNICALL ! Java_sun_management_OperatingSystemImpl_initialize (JNIEnv *env, jclass cls) { page_size = sysconf(_SC_PAGESIZE); } JNIEXPORT jlong JNICALL ! Java_sun_management_OperatingSystemImpl_getCommittedVirtualMemorySize (JNIEnv *env, jobject mbean) { #ifdef __solaris__ psinfo_t psinfo; ssize_t result;
*** 247,271 **** return (64 * MB); #endif } JNIEXPORT jlong JNICALL ! Java_com_sun_management_UnixOperatingSystem_getTotalSwapSpaceSize (JNIEnv *env, jobject mbean) { return get_total_or_available_swap_space_size(env, JNI_FALSE); } JNIEXPORT jlong JNICALL ! Java_com_sun_management_UnixOperatingSystem_getFreeSwapSpaceSize (JNIEnv *env, jobject mbean) { return get_total_or_available_swap_space_size(env, JNI_TRUE); } JNIEXPORT jlong JNICALL ! Java_com_sun_management_UnixOperatingSystem_getProcessCpuTime (JNIEnv *env, jobject mbean) { #ifdef __APPLE__ struct rusage usage; if (getrusage(RUSAGE_SELF, &usage) != 0) { --- 247,271 ---- return (64 * MB); #endif } JNIEXPORT jlong JNICALL ! Java_sun_management_OperatingSystemImpl_getTotalSwapSpaceSize (JNIEnv *env, jobject mbean) { return get_total_or_available_swap_space_size(env, JNI_FALSE); } JNIEXPORT jlong JNICALL ! Java_sun_management_OperatingSystemImpl_getFreeSwapSpaceSize (JNIEnv *env, jobject mbean) { return get_total_or_available_swap_space_size(env, JNI_TRUE); } JNIEXPORT jlong JNICALL ! Java_sun_management_OperatingSystemImpl_getProcessCpuTime (JNIEnv *env, jobject mbean) { #ifdef __APPLE__ struct rusage usage; if (getrusage(RUSAGE_SELF, &usage) != 0) {
*** 303,313 **** return cpu_time_ns; #endif } JNIEXPORT jlong JNICALL ! Java_com_sun_management_UnixOperatingSystem_getFreePhysicalMemorySize (JNIEnv *env, jobject mbean) { #ifdef __APPLE__ mach_msg_type_number_t count; vm_statistics_data_t vm_stats; --- 303,313 ---- return cpu_time_ns; #endif } JNIEXPORT jlong JNICALL ! Java_sun_management_OperatingSystemImpl_getFreePhysicalMemorySize (JNIEnv *env, jobject mbean) { #ifdef __APPLE__ mach_msg_type_number_t count; vm_statistics_data_t vm_stats;
*** 331,341 **** return (num_avail_physical_pages * page_size); #endif } JNIEXPORT jlong JNICALL ! Java_com_sun_management_UnixOperatingSystem_getTotalPhysicalMemorySize (JNIEnv *env, jobject mbean) { #ifdef _ALLBSD_SOURCE jlong result = 0; int mib[2]; --- 331,341 ---- return (num_avail_physical_pages * page_size); #endif } JNIEXPORT jlong JNICALL ! Java_sun_management_OperatingSystemImpl_getTotalPhysicalMemorySize (JNIEnv *env, jobject mbean) { #ifdef _ALLBSD_SOURCE jlong result = 0; int mib[2];
*** 356,366 **** } JNIEXPORT jlong JNICALL ! Java_com_sun_management_UnixOperatingSystem_getOpenFileDescriptorCount (JNIEnv *env, jobject mbean) { #ifdef __APPLE__ // This code is influenced by the darwin lsof source pid_t my_pid; --- 356,366 ---- } JNIEXPORT jlong JNICALL ! Java_sun_management_OperatingSystemImpl_getOpenFileDescriptorCount (JNIEnv *env, jobject mbean) { #ifdef __APPLE__ // This code is influenced by the darwin lsof source pid_t my_pid;
*** 436,446 **** return (fds - 1); #endif } JNIEXPORT jlong JNICALL ! Java_com_sun_management_UnixOperatingSystem_getMaxFileDescriptorCount (JNIEnv *env, jobject mbean) { struct rlimit rlp; if (getrlimit(RLIMIT_NOFILE, &rlp) == -1) { --- 436,446 ---- return (fds - 1); #endif } JNIEXPORT jlong JNICALL ! Java_sun_management_OperatingSystemImpl_getMaxFileDescriptorCount (JNIEnv *env, jobject mbean) { struct rlimit rlp; if (getrlimit(RLIMIT_NOFILE, &rlp) == -1) {