diff --git a/Network/Socket.hsc b/Network/Socket.hsc
--- a/Network/Socket.hsc
+++ b/Network/Socket.hsc
@@ -2077,7 +2077,7 @@
                            (mkIOError NoSuchThing "getNameInfo" Nothing 
                             Nothing) err)
 
-foreign import ccall safe "getnameinfo"
+foreign import ccall safe "hsnet_getnameinfo"
     c_getnameinfo :: Ptr SockAddr -> CInt{-CSockLen???-} -> CString -> CSize -> CString
                   -> CSize -> CInt -> IO CInt
 #endif
diff --git a/include/HsNet.h b/include/HsNet.h
--- a/include/HsNet.h
+++ b/include/HsNet.h
@@ -150,6 +150,17 @@
 
 #ifdef HAVE_GETADDRINFO
 INLINE int
+hsnet_getnameinfo(const struct sockaddr* a,socklen_t b, char* c,
+# if defined(HAVE_WINSOCK2_H) && !defined(__CYGWIN__)
+                  DWORD d, char* e, DWORD f, int g)
+# else
+                  socklen_t d, char* e, socklen_t f, int g)
+# endif
+{
+  return getnameinfo(a,b,c,d,e,f,g);
+}
+
+INLINE int
 hsnet_getaddrinfo(const char *hostname, const char *servname,
 		  const struct addrinfo *hints, struct addrinfo **res)
 {
diff --git a/network.cabal b/network.cabal
--- a/network.cabal
+++ b/network.cabal
@@ -1,5 +1,5 @@
 name:           network
-version:        2.2.1.3
+version:        2.2.1.4
 license:        BSD3
 license-file:   LICENSE
 maintainer:     Johan Tibell <johan.tibell@gmail.com>
