From 17d57231c4d9d3dfb486b6d37b85d57e6065958e Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Thu, 16 Mar 2017 03:16:51 +0000 Subject: tcp_info: support this struct under FreeBSD Of course these fields are not portable between Linux and FreeBSD, but they should remain ABI-compatible for future versions of each OS. Tested on FreeBSD 10.3-RELEASE i386 TCP state names will be another problem... --- ext/raindrops/raindrops.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'ext/raindrops/raindrops.c') diff --git a/ext/raindrops/raindrops.c b/ext/raindrops/raindrops.c index 390b8b8..0ea3e32 100644 --- a/ext/raindrops/raindrops.c +++ b/ext/raindrops/raindrops.c @@ -336,7 +336,9 @@ static VALUE aref(VALUE self, VALUE index) #ifdef __linux__ void Init_raindrops_linux_inet_diag(void); -void Init_raindrops_linux_tcp_info(void); +#endif +#ifdef HAVE_TYPE_STRUCT_TCP_INFO +void Init_raindrops_tcp_info(void); #endif #ifndef _SC_NPROCESSORS_CONF @@ -441,6 +443,8 @@ void Init_raindrops_ext(void) #ifdef __linux__ Init_raindrops_linux_inet_diag(); - Init_raindrops_linux_tcp_info(); +#endif +#ifdef HAVE_TYPE_STRUCT_TCP_INFO + Init_raindrops_tcp_info(); #endif } -- cgit v1.2.3-24-ge0c7