summaryrefslogtreecommitdiff
path: root/src/win32/socket.h
blob: 8b0159ebe9c3d4b5624bb4852a77014ef1fe3de5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
/* POSIX emulation layer for Windows.
 *
 * (C) 2008-2024 Anope Team
 * Contact us at team@anope.org
 *
 * Please read COPYING and README for further details.
 */

#define read read_not_used
#define write write_not_used
#include <io.h>
#undef read
#undef write

#define F_GETFL 0
#define F_SETFL 1

#define O_NONBLOCK 1

extern CoreExport int read(int fd, char *buf, size_t count);
extern CoreExport int write(int fd, const char *buf, size_t count);
extern CoreExport int windows_close(int fd);
extern CoreExport int windows_accept(int fd, struct sockaddr *addr, int *addrlen);
extern CoreExport int fcntl(int fd, int cmd, int arg);

#ifndef WIN32_NO_OVERRIDE
# define accept windows_accept
#endif