diff options
| author | Geoff Voelker | 1997-07-10 20:10:09 +0000 |
|---|---|---|
| committer | Geoff Voelker | 1997-07-10 20:10:09 +0000 |
| commit | 380961a6723107adce146743f2fb2f8787e7bd69 (patch) | |
| tree | 0af01ae7be84a085aa1e4aebf01cfd2fc98a796d /src | |
| parent | 4d8c7bc330f086f0a0fe2ee549517f4ff6193414 (diff) | |
| download | emacs-380961a6723107adce146743f2fb2f8787e7bd69.tar.gz emacs-380961a6723107adce146743f2fb2f8787e7bd69.zip | |
(sys_shutdown): New function.
Diffstat (limited to 'src')
| -rw-r--r-- | src/w32.c | 24 |
1 files changed, 24 insertions, 0 deletions
| @@ -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 | ||
| 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 | ||