1
/*! \file unix/socketimpl.h \n
2
* \author Spiro Trikaliotis\n
3
* \brief Abstraction from network sockets.
5
* socketimpl.h - Abstraction from network sockets. Unix implementation.
8
* Spiro Trikaliotis <spiro.trikaliotis@gmx.de>
10
* based on code from network.c written by
11
* Andreas Matthies <andreas.matthies@gmx.net>
13
* This file is part of VICE, the Versatile Commodore Emulator.
14
* See README for copyright notice.
16
* This program is free software; you can redistribute it and/or modify
17
* it under the terms of the GNU General Public License as published by
18
* the Free Software Foundation; either version 2 of the License, or
19
* (at your option) any later version.
21
* This program is distributed in the hope that it will be useful,
22
* but WITHOUT ANY WARRANTY; without even the implied warranty of
23
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
24
* GNU General Public License for more details.
26
* You should have received a copy of the GNU General Public License
27
* along with this program; if not, write to the Free Software
28
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
33
#ifndef VICE_SOCKETIMPL_H
34
#define VICE_SOCKETIMPL_H
40
# define PF_INET AF_INET
42
# ifndef MINIX_HAS_RECV_SEND
43
extern ssize_t recv(int socket, void *buffer, size_t length, int flags);
44
extern ssize_t send(int socket, const void *buffer, size_t length, int flags);
47
#endif /* #ifdef MINIX_SUPPORT */
49
#if !defined(HAVE_GETDTABLESIZE) && defined(HAVE_GETRLIMIT)
50
#include <sys/resource.h>
53
#include <sys/types.h>
54
#include <sys/socket.h>
56
#include <netinet/in.h>
57
#include <arpa/inet.h>
62
#include <sys/select.h>
68
# define recv(socket, buffer, length, flags) recvfrom(socket, buffer, length, flags, NULL, NULL)
69
extern ssize_t send(int socket, const void *buffer, size_t length, int flags);
72
typedef unsigned int SOCKET;
73
typedef struct timeval TIMEVAL;
75
#define closesocket close
77
#ifndef INVALID_SOCKET
78
# define INVALID_SOCKET (SOCKET)(~0)
81
#define SOCKET_IS_INVALID(_x) ((_x) < 0)
84
#define INADDR_NONE ((unsigned long)-1)
88
typedef unsigned long in_addr_t;
91
#endif /* #ifdef HAVE_NETWORK */
93
#endif /* #ifndef VICE_SOCKETIMPL_H */