changeset 23054:9ce297e5f4a2

8035952: Remove use of JVM_Open, JVM_Read and JVM_Close functions from serviceability code Reviewed-by: chegar, mchung, alanb, sla
author fparain
date Wed, 05 Mar 2014 10:52:33 +0000
parents 788f0ea9a703
children 63ec3bde101c
files jdk/src/solaris/native/sun/management/OperatingSystemImpl.c
diffstat 1 files changed, 12 insertions(+), 9 deletions(-) [+]
line wrap: on
line diff
--- a/jdk/src/solaris/native/sun/management/OperatingSystemImpl.c	Tue Mar 04 09:35:54 2014 +0100
+++ b/jdk/src/solaris/native/sun/management/OperatingSystemImpl.c	Wed Mar 05 10:52:33 2014 +0000
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -196,7 +196,7 @@
     char* addr;
     int fd;
 
-    fd = JVM_Open("/proc/self/psinfo", O_RDONLY, 0);
+    fd = open64("/proc/self/psinfo", O_RDONLY, 0);
     if (fd < 0) {
         throw_internal_error(env, "Unable to open /proc/self/psinfo");
         return -1;
@@ -204,17 +204,20 @@
 
     addr = (char *)&psinfo;
     for (remaining = sizeof(psinfo_t); remaining > 0;) {
-        result = JVM_Read(fd, addr, remaining);
+        result = read(fd, addr, remaining);
         if (result < 0) {
-            JVM_Close(fd);
-            throw_internal_error(env, "Unable to read /proc/self/psinfo");
-            return -1;
+            if (errno != EINTR) {
+                close(fd);
+                throw_internal_error(env, "Unable to read /proc/self/psinfo");
+                return -1;
+            }
+        } else {
+            remaining -= result;
+            addr += result;
         }
-        remaining -= result;
-        addr += result;
     }
 
-    JVM_Close(fd);
+    close(fd);
     return (jlong) psinfo.pr_size * 1024;
 #elif defined(__linux__)
     FILE *fp;