< prev index next >
src/java.base/unix/native/libjava/ProcessHandleImpl_unix.c
Print this page
rev 59105 : imported patch corelibs
@@ -43,24 +43,14 @@
#include <limits.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <sys/wait.h>
-/* For POSIX-compliant getpwuid_r on Solaris */
-#if defined(__solaris__)
-#define _POSIX_PTHREAD_SEMANTICS
-#endif
#include <pwd.h>
-#ifdef _AIX
-#include <sys/procfs.h>
-#endif
-#ifdef __solaris__
-#include <procfs.h>
-#endif
-
#if defined(_AIX)
+ #include <sys/procfs.h>
#define DIR DIR64
#define dirent dirent64
#define opendir opendir64
#define readdir readdir64
#define closedir closedir64
@@ -136,22 +126,17 @@
#ifndef WTERMSIG
#define WTERMSIG(status) ((status)&0x7F)
#endif
-#ifdef __solaris__
/* The child exited because of a signal.
* The best value to return is 0x80 + signal number,
* because that is what all Unix shells do, and because
* it allows callers to distinguish between process exit and
* process death by signal.
- * Unfortunately, the historical behavior on Solaris is to return
- * the signal number, and we preserve this for compatibility. */
-#define WTERMSIG_RETURN(status) WTERMSIG(status)
-#else
+ */
#define WTERMSIG_RETURN(status) (WTERMSIG(status) + 0x80)
-#endif
#define RESTARTABLE(_cmd, _result) do { \
do { \
_result = _cmd; \
} while((_result == -1) && (errno == EINTR)); \
@@ -501,11 +486,11 @@
/*
* The following functions are common on Solaris, Linux and AIX.
*/
-#if defined(__solaris__) || defined (__linux__) || defined(_AIX)
+#if defined (__linux__) || defined(_AIX)
/*
* Returns the children of the requested pid and optionally each parent and
* start time.
* Reads /proc and accumulates any process who parent pid matches.
@@ -620,17 +605,17 @@
closedir(dir);
// If more pids than array had size for; count will be greater than array size
return count;
}
-#endif // defined(__solaris__) || defined (__linux__) || defined(_AIX)
+#endif // defined (__linux__) || defined(_AIX)
/*
- * The following functions are common on Solaris and AIX.
+ * The following functions are for AIX.
*/
-#if defined(__solaris__) || defined(_AIX)
+#if defined(_AIX)
/**
* Helper function to get the 'psinfo_t' data from "/proc/%d/psinfo".
* Returns 0 on success and -1 on error.
*/
@@ -690,23 +675,10 @@
char prargs[PRARGSZ + 1];
jstring cmdexe = NULL;
int ret;
/*
- * On Solaris, the full path to the executable command is the link in
- * /proc/<pid>/paths/a.out. But it is only readable for processes we own.
- */
-#if defined(__solaris__)
- snprintf(fn, sizeof fn, "/proc/%d/path/a.out", pid);
- if ((ret = readlink(fn, exePath, PATH_MAX - 1)) > 0) {
- // null terminate and create String to store for command
- exePath[ret] = '\0';
- CHECK_NULL(cmdexe = JNU_NewStringPlatform(env, exePath));
- }
-#endif
-
- /*
* Now try to open /proc/%d/psinfo
*/
if (getPsinfo(pid, &psinfo) < 0) {
unix_fillArgArray(env, jinfo, 0, NULL, NULL, cmdexe, NULL);
return;
@@ -731,6 +703,6 @@
}
unix_fillArgArray(env, jinfo, 0, NULL, NULL, cmdexe,
prargs[0] == '\0' ? NULL : prargs);
}
-#endif // defined(__solaris__) || defined(_AIX)
+#endif // defined(_AIX)
< prev index next >