jdk/src/solaris/native/java/lang/childproc.c
changeset 22597 7515a991bb37
parent 19399 e2e5122cd62e
--- a/jdk/src/solaris/native/java/lang/childproc.c	Thu Nov 21 12:28:16 2013 -0800
+++ b/jdk/src/solaris/native/java/lang/childproc.c	Tue Nov 26 16:40:31 2013 +0100
@@ -66,6 +66,9 @@
 #define FD_DIR "/dev/fd"
 #define dirent64 dirent
 #define readdir64 readdir
+#elif defined(_AIX)
+/* AIX does not understand '/proc/self' - it requires the real process ID */
+#define FD_DIR aix_fd_dir
 #else
 #define FD_DIR "/proc/self/fd"
 #endif
@@ -87,6 +90,12 @@
     close(from_fd);          /* for possible use by opendir() */
     close(from_fd + 1);      /* another one for good luck */
 
+#if defined(_AIX)
+    /* AIX does not understand '/proc/self' - it requires the real process ID */
+    char aix_fd_dir[32];     /* the pid has at most 19 digits */
+    snprintf(aix_fd_dir, 32, "/proc/%d/fd", getpid());
+#endif
+
     if ((dp = opendir(FD_DIR)) == NULL)
         return 0;