changeset 18725:07145cb40453

(sys_shutdown): New function.
author Geoff Voelker <voelker@cs.washington.edu>
date Thu, 10 Jul 1997 20:10:09 +0000
parents 745be19af9d9
children cfbf43d0fd54
files src/w32.c
diffstat 1 files changed, 24 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/src/w32.c	Thu Jul 10 20:09:50 1997 +0000
+++ b/src/w32.c	Thu Jul 10 20:10:09 1997 +0000
@@ -73,6 +73,7 @@
 #undef gethostname
 #undef gethostbyname
 #undef getservbyname
+#undef shutdown
 #endif
 
 #include "w32.h"
@@ -1779,6 +1780,29 @@
   return serv;
 }
 
+int
+sys_shutdown (int s, int how)
+{
+  int rc;
+
+  if (winsock_lib == NULL)
+    {
+      h_errno = ENETDOWN;
+      return SOCKET_ERROR;
+    }
+
+  check_errno ();
+  if (fd_info[s].flags & FILE_SOCKET)
+    {
+      int rc = pfn_shutdown (SOCK_HANDLE (s), how);
+      if (rc == SOCKET_ERROR)
+	set_errno ();
+      return rc;
+    }
+  h_errno = ENOTSOCK;
+  return SOCKET_ERROR;
+}
+
 #endif /* HAVE_SOCKETS */