summaryrefslogtreecommitdiffstats
path: root/gl/sys_socket.in.h
diff options
context:
space:
mode:
authorThomas Guyot-Sionnest <dermoth@users.sourceforge.net>2008-02-12 11:07:18 (GMT)
committerThomas Guyot-Sionnest <dermoth@users.sourceforge.net>2008-02-12 11:07:18 (GMT)
commitbd7029a99b0c2974265c6665638ef14a052f42ab (patch)
treef5661ba73366d81ef6e91f889ea7fec5ebe07b6b /gl/sys_socket.in.h
parentf99612320d6eda67644c07be04bb21aa4d7789db (diff)
downloadmonitoring-plugins-bd7029a99b0c2974265c6665638ef14a052f42ab.tar.gz
Sync to latest Gnulib
git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@1925 f882894a-f735-0410-b71e-b25c423dba1c
Diffstat (limited to 'gl/sys_socket.in.h')
-rw-r--r--gl/sys_socket.in.h91
1 files changed, 91 insertions, 0 deletions
diff --git a/gl/sys_socket.in.h b/gl/sys_socket.in.h
new file mode 100644
index 0000000..5e0b097
--- /dev/null
+++ b/gl/sys_socket.in.h
@@ -0,0 +1,91 @@
1/* Provide a sys/socket header file for systems lacking it (read: MinGW).
2 Copyright (C) 2005, 2006, 2007 Free Software Foundation, Inc.
3 Written by Simon Josefsson.
4
5 This program is free software; you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation; either version 3, or (at your option)
8 any later version.
9
10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details.
14
15 You should have received a copy of the GNU General Public License
16 along with this program; if not, write to the Free Software Foundation,
17 Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
18
19/* This file is supposed to be used on platforms that lack <sys/socket.h>
20 and on platforms where <sys/socket.h> cannot be included standalone.
21 It is intended to provide definitions and prototypes needed by an
22 application. */
23
24#ifndef _GL_SYS_SOCKET_H
25
26#if @HAVE_SYS_SOCKET_H@
27
28/* On many platforms, <sys/socket.h> assumes prior inclusion of
29 <sys/types.h>. */
30# include <sys/types.h>
31
32/* The include_next requires a split double-inclusion guard. */
33# @INCLUDE_NEXT@ @NEXT_SYS_SOCKET_H@
34
35#endif
36
37#ifndef _GL_SYS_SOCKET_H
38#define _GL_SYS_SOCKET_H
39
40#if !@HAVE_SYS_SOCKET_H@
41
42/* A platform that lacks <sys/socket.h>.
43
44 Currently only MinGW is supported. See the gnulib manual regarding
45 Windows sockets. MinGW has the header files winsock2.h and
46 ws2tcpip.h that declare the sys/socket.h definitions we need. Note
47 that you can influence which definitions you get by setting the
48 WINVER symbol before including these two files. For example,
49 getaddrinfo is only available if _WIN32_WINNT >= 0x0501 (that
50 symbol is set indiriectly through WINVER). You can set this by
51 adding AC_DEFINE(WINVER, 0x0501) to configure.ac. Note that your
52 code may not run on older Windows releases then. My Windows 2000
53 box was not able to run the code, for example. The situation is
54 slightly confusing because:
55 http://msdn.microsoft.com/library/default.asp?url=/library/en-us/winsock/winsock/getaddrinfo_2.asp
56 suggests that getaddrinfo should be available on all Windows
57 releases. */
58
59
60# if @HAVE_WINSOCK2_H@
61# include <winsock2.h>
62# endif
63# if @HAVE_WS2TCPIP_H@
64# include <ws2tcpip.h>
65# endif
66
67/* For shutdown(). */
68# if !defined SHUT_RD && defined SD_RECEIVE
69# define SHUT_RD SD_RECEIVE
70# endif
71# if !defined SHUT_WR && defined SD_SEND
72# define SHUT_WR SD_SEND
73# endif
74# if !defined SHUT_RDWR && defined SD_BOTH
75# define SHUT_RDWR SD_BOTH
76# endif
77
78# if defined _WIN32 || defined __WIN32__
79# define ENOTSOCK WSAENOTSOCK
80# define EADDRINUSE WSAEADDRINUSE
81# define ENETRESET WSAENETRESET
82# define ECONNABORTED WSAECONNABORTED
83# define ECONNRESET WSAECONNRESET
84# define ENOTCONN WSAENOTCONN
85# define ESHUTDOWN WSAESHUTDOWN
86# endif
87
88#endif /* HAVE_SYS_SOCKET_H */
89
90#endif /* _GL_SYS_SOCKET_H */
91#endif /* _GL_SYS_SOCKET_H */