From 380961a6723107adce146743f2fb2f8787e7bd69 Mon Sep 17 00:00:00 2001 From: Geoff Voelker Date: Thu, 10 Jul 1997 20:10:09 +0000 Subject: [PATCH] (sys_shutdown): New function. --- src/w32.c | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/src/w32.c b/src/w32.c index 734d6276e8f..b0646c91e96 100644 --- a/src/w32.c +++ b/src/w32.c @@ -73,6 +73,7 @@ Boston, MA 02111-1307, USA. #undef gethostname #undef gethostbyname #undef getservbyname +#undef shutdown #endif #include "w32.h" @@ -1779,6 +1780,29 @@ sys_getservbyname(const char * name, const char * proto) 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 */ -- 2.39.5