Mercurial > emacs
comparison src/w32.c @ 18725:07145cb40453
(sys_shutdown): New function.
author | Geoff Voelker <voelker@cs.washington.edu> |
---|---|
date | Thu, 10 Jul 1997 20:10:09 +0000 |
parents | a8a539285d69 |
children | 974a890c1d12 |
comparison
equal
deleted
inserted
replaced
18724:745be19af9d9 | 18725:07145cb40453 |
---|---|
71 #undef ntohs | 71 #undef ntohs |
72 #undef inet_addr | 72 #undef inet_addr |
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" |
79 #include "ndir.h" | 80 #include "ndir.h" |
80 #include "w32heap.h" | 81 #include "w32heap.h" |
1777 if (!serv) | 1778 if (!serv) |
1778 set_errno (); | 1779 set_errno (); |
1779 return serv; | 1780 return serv; |
1780 } | 1781 } |
1781 | 1782 |
1783 int | |
1784 sys_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 |
1785 /* Shadow main io functions: we need to handle pipes and sockets more | 1809 /* Shadow main io functions: we need to handle pipes and sockets more |
1786 intelligently, and implement non-blocking mode as well. */ | 1810 intelligently, and implement non-blocking mode as well. */ |