From bcb098a34d0da8c3e033c9c84eba7b9706a6e8ad Mon Sep 17 00:00:00 2001 From: Doug MacEachern Date: Wed, 16 Mar 2005 02:47:57 +0000 Subject: [PATCH] stub proc_port for all platforms --- bindings/java/src/jni/javasigar.c | 10 ++-------- src/os/darwin/darwin_sigar.c | 6 ++++++ src/os/hpux/hpux_sigar.c | 6 ++++++ src/os/osf1/osf1_sigar.c | 6 ++++++ src/os/solaris/solaris_sigar.c | 6 ++++++ src/os/stub/stub_sigar.c | 6 ++++++ 6 files changed, 32 insertions(+), 8 deletions(-) diff --git a/bindings/java/src/jni/javasigar.c b/bindings/java/src/jni/javasigar.c index 76ab919d..c10a2af8 100644 --- a/bindings/java/src/jni/javasigar.c +++ b/bindings/java/src/jni/javasigar.c @@ -868,18 +868,12 @@ JNIEXPORT jlong SIGAR_JNI(Sigar_getProcPort) sigar_pid_t pid; dSIGAR(0); -#if defined(__linux__) || defined(WIN32) - /* just thinking about implementing this on other platforms hurts */ - status = sigar_proc_port_get(sigar, SIGAR_NETCONN_TCP, + status = sigar_proc_port_get(sigar, SIGAR_NETCONN_TCP, /*XXX UDP*/ (unsigned long)port, &pid); if (status != SIGAR_OK) { sigar_throw_error(env, jsigar, status); + return -1; } -#else - status = SIGAR_ENOTIMPL; - pid = -1; - sigar_throw_error(env, jsigar, status); -#endif return pid; } diff --git a/src/os/darwin/darwin_sigar.c b/src/os/darwin/darwin_sigar.c index ef85e2e4..1b1284a6 100644 --- a/src/os/darwin/darwin_sigar.c +++ b/src/os/darwin/darwin_sigar.c @@ -1546,3 +1546,9 @@ int sigar_net_connection_list_get(sigar_t *sigar, } #endif + +int sigar_proc_port_get(sigar_t *sigar, int protocol, + unsigned long port, sigar_pid_t *pid) +{ + return SIGAR_ENOTIMPL; +} diff --git a/src/os/hpux/hpux_sigar.c b/src/os/hpux/hpux_sigar.c index 404ef0cf..ef13d0ee 100644 --- a/src/os/hpux/hpux_sigar.c +++ b/src/os/hpux/hpux_sigar.c @@ -808,3 +808,9 @@ int sigar_net_connection_list_get(sigar_t *sigar, { return SIGAR_ENOTIMPL; } + +int sigar_proc_port_get(sigar_t *sigar, int protocol, + unsigned long port, sigar_pid_t *pid) +{ + return SIGAR_ENOTIMPL; +} diff --git a/src/os/osf1/osf1_sigar.c b/src/os/osf1/osf1_sigar.c index 74f52e65..1556fc51 100644 --- a/src/os/osf1/osf1_sigar.c +++ b/src/os/osf1/osf1_sigar.c @@ -527,3 +527,9 @@ int sigar_net_connection_list_get(sigar_t *sigar, { return SIGAR_ENOTIMPL; } + +int sigar_proc_port_get(sigar_t *sigar, int protocol, + unsigned long port, sigar_pid_t *pid) +{ + return SIGAR_ENOTIMPL; +} diff --git a/src/os/solaris/solaris_sigar.c b/src/os/solaris/solaris_sigar.c index d5ceee91..2f997734 100644 --- a/src/os/solaris/solaris_sigar.c +++ b/src/os/solaris/solaris_sigar.c @@ -2010,3 +2010,9 @@ int sigar_net_connection_list_get(sigar_t *sigar, return SIGAR_OK; } + +int sigar_proc_port_get(sigar_t *sigar, int protocol, + unsigned long port, sigar_pid_t *pid) +{ + return SIGAR_ENOTIMPL; +} diff --git a/src/os/stub/stub_sigar.c b/src/os/stub/stub_sigar.c index 96e170fa..9b1d7b1b 100644 --- a/src/os/stub/stub_sigar.c +++ b/src/os/stub/stub_sigar.c @@ -257,3 +257,9 @@ int sigar_net_connection_list_get(sigar_t *sigar, { return SIGAR_ENOTIMPL; } + +int sigar_proc_port_get(sigar_t *sigar, int protocol, + unsigned long port, sigar_pid_t *pid) +{ + return SIGAR_ENOTIMPL; +}