diff --git a/cbits/sockopt.c b/cbits/sockopt.c
--- a/cbits/sockopt.c
+++ b/cbits/sockopt.c
@@ -1,10 +1,11 @@
 #include <stdint.h>
 
-#if unix
+#if unix || __APPLE__
 
 #include <netinet/in.h>
 #include <netinet/tcp.h>
 #include <sys/socket.h>
+#include <sys/time.h>
 #include <sys/types.h>
 
 typedef socklen_t my_socklen_t;
@@ -31,7 +32,7 @@
 
 int c_getsockopt_time(int sockfd, int level, int optname, int64_t *usec_out)
 {
-#if unix
+#if unix || __APPLE__
     struct timeval tv;
     my_socklen_t optlen = sizeof(tv);
     int rc = getsockopt(sockfd, level, optname, (void *) &tv, &optlen);
@@ -54,7 +55,7 @@
 
 int c_setsockopt_time(int sockfd, int level, int optname, int64_t usec)
 {
-#if unix
+#if unix || __APPLE__
     struct timeval tv;
 
     if (usec <= 0) {
diff --git a/network-socket-options.cabal b/network-socket-options.cabal
--- a/network-socket-options.cabal
+++ b/network-socket-options.cabal
@@ -1,5 +1,5 @@
 name:                network-socket-options
-version:             0.2
+version:             0.2.0.1
 synopsis:            Type-safe, portable alternative to getSocketOption/setSocketOption
 description:
     The network package provides getSocketOption and setSocketOption functions.
