1
/* Copyright (C) 2003 MySQL AB
3
This program is free software; you can redistribute it and/or modify
4
it under the terms of the GNU General Public License as published by
5
the Free Software Foundation; either version 2 of the License, or
6
(at your option) any later version.
8
This program is distributed in the hope that it will be useful,
9
but WITHOUT ANY WARRANTY; without even the implied warranty of
10
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11
GNU General Public License for more details.
13
You should have received a copy of the GNU General Public License
14
along with this program; if not, write to the Free Software
15
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
20
#include <ndb_global.h>
23
#if defined NDB_OSE || defined NDB_SOFTOSE
25
* Include files needed
31
#define NDB_NONBLOCK FNDELAY
32
#define NDB_SOCKET_TYPE int
33
#define NDB_INVALID_SOCKET -1
34
#define _NDB_CLOSE_SOCKET(x) close(x)
37
* socklen_t not defined in the header files of OSE
39
typedef int socklen_t;
41
#define InetErrno (* inet_errno())
43
#elif defined NDB_WIN32
46
* Include files needed
51
#define InetErrno WSAGetLastError()
52
#define EWOULDBLOCK WSAEWOULDBLOCK
53
#define NDB_SOCKET_TYPE SOCKET
54
#define NDB_INVALID_SOCKET INVALID_SOCKET
55
#define _NDB_CLOSE_SOCKET(x) closesocket(x)
60
* Include files needed
64
#define NDB_NONBLOCK O_NONBLOCK
65
#define NDB_SOCKET_TYPE int
66
#define NDB_INVALID_SOCKET -1
67
#define _NDB_CLOSE_SOCKET(x) ::close(x)
69
#define InetErrno errno
73
#define NDB_SOCKLEN_T SOCKET_SIZE_TYPE
80
* Convert host name or ip address to in_addr
82
* Returns 0 on success
90
int Ndb_getInAddr(struct in_addr * dst, const char *address);
93
#define NDB_CLOSE_SOCKET(fd) _NDB_CLOSE_SOCKET(fd)
95
int NDB_CLOSE_SOCKET(int fd);
98
int Ndb_check_socket_hup(NDB_SOCKET_TYPE sock);