stub proc_port for all platforms

This commit is contained in:
Doug MacEachern 2005-03-16 02:47:57 +00:00
parent c31d2c5712
commit bcb098a34d
6 changed files with 32 additions and 8 deletions

View File

@ -868,18 +868,12 @@ JNIEXPORT jlong SIGAR_JNI(Sigar_getProcPort)
sigar_pid_t pid; sigar_pid_t pid;
dSIGAR(0); dSIGAR(0);
#if defined(__linux__) || defined(WIN32) status = sigar_proc_port_get(sigar, SIGAR_NETCONN_TCP, /*XXX UDP*/
/* just thinking about implementing this on other platforms hurts */
status = sigar_proc_port_get(sigar, SIGAR_NETCONN_TCP,
(unsigned long)port, &pid); (unsigned long)port, &pid);
if (status != SIGAR_OK) { if (status != SIGAR_OK) {
sigar_throw_error(env, jsigar, status); sigar_throw_error(env, jsigar, status);
return -1;
} }
#else
status = SIGAR_ENOTIMPL;
pid = -1;
sigar_throw_error(env, jsigar, status);
#endif
return pid; return pid;
} }

View File

@ -1546,3 +1546,9 @@ int sigar_net_connection_list_get(sigar_t *sigar,
} }
#endif #endif
int sigar_proc_port_get(sigar_t *sigar, int protocol,
unsigned long port, sigar_pid_t *pid)
{
return SIGAR_ENOTIMPL;
}

View File

@ -808,3 +808,9 @@ int sigar_net_connection_list_get(sigar_t *sigar,
{ {
return SIGAR_ENOTIMPL; return SIGAR_ENOTIMPL;
} }
int sigar_proc_port_get(sigar_t *sigar, int protocol,
unsigned long port, sigar_pid_t *pid)
{
return SIGAR_ENOTIMPL;
}

View File

@ -527,3 +527,9 @@ int sigar_net_connection_list_get(sigar_t *sigar,
{ {
return SIGAR_ENOTIMPL; return SIGAR_ENOTIMPL;
} }
int sigar_proc_port_get(sigar_t *sigar, int protocol,
unsigned long port, sigar_pid_t *pid)
{
return SIGAR_ENOTIMPL;
}

View File

@ -2010,3 +2010,9 @@ int sigar_net_connection_list_get(sigar_t *sigar,
return SIGAR_OK; return SIGAR_OK;
} }
int sigar_proc_port_get(sigar_t *sigar, int protocol,
unsigned long port, sigar_pid_t *pid)
{
return SIGAR_ENOTIMPL;
}

View File

@ -257,3 +257,9 @@ int sigar_net_connection_list_get(sigar_t *sigar,
{ {
return SIGAR_ENOTIMPL; return SIGAR_ENOTIMPL;
} }
int sigar_proc_port_get(sigar_t *sigar, int protocol,
unsigned long port, sigar_pid_t *pid)
{
return SIGAR_ENOTIMPL;
}