source: sock.h @ a9a7287

Last change on this file since a9a7287 was 0a14b8c, checked in by Jelmer Vernooij <jelmer@…>, at 2008-04-02T15:03:37Z

Remove no longer needed functions.

  • Property mode set to 100644
File size: 969 bytes
Line 
1#include <errno.h>
2#include <fcntl.h>
3
4#ifndef _WIN32
5#include <unistd.h>
6#include <sys/socket.h>
7#include <netinet/in.h>
8#include <arpa/inet.h>
9#include <netdb.h>
10#define sock_make_nonblocking(fd) fcntl(fd, F_SETFL, O_NONBLOCK)
11#define sock_make_blocking(fd) fcntl(fd, F_SETFL, 0)
12#define sockerr_again() (errno == EINPROGRESS || errno == EINTR)
13#ifndef EVENTS_LIBEVENT
14#define closesocket(a) close(a)
15#endif
16#else
17# include <winsock2.h>
18# include <ws2tcpip.h>
19# if !defined(BITLBEE_CORE) && defined(_MSC_VER)
20#   pragma comment(lib,"bitlbee.lib")
21# endif
22# include <io.h>
23# define sock_make_nonblocking(fd) { int non_block = 1; ioctlsocket(fd, FIONBIO, &non_block); }
24# define sock_make_blocking(fd) { int non_block = 0; ioctlsocket(fd, FIONBIO, &non_block); }
25# define sockerr_again() (WSAGetLastError() == WSAEINTR || WSAGetLastError() == WSAEINPROGRESS || WSAGetLastError() == WSAEWOULDBLOCK)
26# define ETIMEDOUT WSAETIMEDOUT
27# define sleep(a) Sleep(a*1000)
28#endif
Note: See TracBrowser for help on using the repository browser.