aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorGeoff Voelker1997-07-10 20:10:09 +0000
committerGeoff Voelker1997-07-10 20:10:09 +0000
commit380961a6723107adce146743f2fb2f8787e7bd69 (patch)
tree0af01ae7be84a085aa1e4aebf01cfd2fc98a796d /src
parent4d8c7bc330f086f0a0fe2ee549517f4ff6193414 (diff)
downloademacs-380961a6723107adce146743f2fb2f8787e7bd69.tar.gz
emacs-380961a6723107adce146743f2fb2f8787e7bd69.zip
(sys_shutdown): New function.
Diffstat (limited to 'src')
-rw-r--r--src/w32.c24
1 files changed, 24 insertions, 0 deletions
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.
73#undef gethostname 73#undef gethostname
74#undef gethostbyname 74#undef gethostbyname
75#undef getservbyname 75#undef getservbyname
76#undef shutdown
76#endif 77#endif
77 78
78#include "w32.h" 79#include "w32.h"
@@ -1779,6 +1780,29 @@ sys_getservbyname(const char * name, const char * proto)
1779 return serv; 1780 return serv;
1780} 1781}
1781 1782
1783int
1784sys_shutdown (int s, int how)
1785{
1786 int rc;
1787
1788 if (winsock_lib == NULL)
1789 {
1790 h_errno = ENETDOWN;
1791 return SOCKET_ERROR;
1792 }
1793
1794 check_errno ();
1795 if (fd_info[s].flags & FILE_SOCKET)
1796 {
1797 int rc = pfn_shutdown (SOCK_HANDLE (s), how);
1798 if (rc == SOCKET_ERROR)
1799 set_errno ();
1800 return rc;
1801 }
1802 h_errno = ENOTSOCK;
1803 return SOCKET_ERROR;
1804}
1805
1782#endif /* HAVE_SOCKETS */ 1806#endif /* HAVE_SOCKETS */
1783 1807
1784 1808