summaryrefslogtreecommitdiff
path: root/ext/socket
diff options
context:
space:
mode:
Diffstat (limited to 'ext/socket')
-rw-r--r--ext/socket/extconf.rb2
-rw-r--r--ext/socket/socket.c6
2 files changed, 8 insertions, 0 deletions
diff --git a/ext/socket/extconf.rb b/ext/socket/extconf.rb
index f2eddc0bba7..47addfeff84 100644
--- a/ext/socket/extconf.rb
+++ b/ext/socket/extconf.rb
@@ -149,6 +149,8 @@ EOF
end
have_header("sys/sysctl.h")
+have_header("netinet/tcp.h")
+have_header("netinet/udp.h")
$getaddr_info_ok = false
if try_run(<<EOF)
diff --git a/ext/socket/socket.c b/ext/socket/socket.c
index f7840948f89..a1d707122ec 100644
--- a/ext/socket/socket.c
+++ b/ext/socket/socket.c
@@ -16,6 +16,12 @@
#ifndef NT
#include <sys/socket.h>
#include <netinet/in.h>
+#ifdef NETINET_TCP
+# include <netinet/tcp.h>
+#endif
+#ifdef NETINET_UDP
+# include <netinet/udp.h>
+#endif
#include <netdb.h>
#endif
#include <errno.h>