net_connection_list works on darwin with the proper includes

This commit is contained in:
Doug MacEachern 2005-09-24 15:00:01 +00:00
parent e71a9e5b3e
commit 9fc15b09d8
1 changed files with 13 additions and 8 deletions

View File

@ -1686,9 +1686,11 @@ int sigar_net_interface_stat_get(sigar_t *sigar, const char *name,
return SIGAR_OK; return SIGAR_OK;
} }
#if defined(SIGAR_FREEBSD5) #if defined(SIGAR_FREEBSD5) || defined(DARWIN)
#include <sys/socketvar.h> #include <sys/socketvar.h>
#include <netinet/tcp.h>
#include <netinet/tcpip.h>
#include <netinet/in_pcb.h> #include <netinet/in_pcb.h>
#include <netinet/tcp_var.h> #include <netinet/tcp_var.h>
#include <netinet/tcp_fsm.h> #include <netinet/tcp_fsm.h>
@ -1853,6 +1855,16 @@ int sigar_net_connection_list_get(sigar_t *sigar,
return SIGAR_OK; return SIGAR_OK;
} }
#else
int sigar_net_connection_list_get(sigar_t *sigar,
sigar_net_connection_list_t *connlist,
int flags)
{
return SIGAR_ENOTIMPL;
}
#endif
#if defined(SIGAR_FREEBSD5)
#define _KERNEL #define _KERNEL
#include <sys/file.h> #include <sys/file.h>
@ -1977,13 +1989,6 @@ int sigar_proc_port_get(sigar_t *sigar, int protocol,
#else #else
int sigar_net_connection_list_get(sigar_t *sigar,
sigar_net_connection_list_t *connlist,
int flags)
{
return SIGAR_ENOTIMPL;
}
int sigar_proc_port_get(sigar_t *sigar, int protocol, int sigar_proc_port_get(sigar_t *sigar, int protocol,
unsigned long port, sigar_pid_t *pid) unsigned long port, sigar_pid_t *pid)
{ {