Revision 03ff3ca3 vl.c
b/vl.c | ||
---|---|---|
100 | 100 |
#include <stropts.h> |
101 | 101 |
#endif |
102 | 102 |
#endif |
103 |
#else |
|
104 |
#include <winsock2.h> |
|
105 |
int inet_aton(const char *cp, struct in_addr *ia); |
|
106 | 103 |
#endif |
107 | 104 |
|
105 |
#include "qemu_socket.h" |
|
106 |
|
|
108 | 107 |
#if defined(CONFIG_SLIRP) |
109 | 108 |
#include "libslirp.h" |
110 | 109 |
#endif |
... | ... | |
125 | 124 |
#define memalign(align, size) malloc(size) |
126 | 125 |
#endif |
127 | 126 |
|
128 |
#include "qemu_socket.h" |
|
129 |
|
|
130 | 127 |
#ifdef CONFIG_SDL |
131 | 128 |
#ifdef __APPLE__ |
132 | 129 |
#include <SDL/SDL.h> |
... | ... | |
2133 | 2130 |
return len1 - len; |
2134 | 2131 |
} |
2135 | 2132 |
|
2136 |
void socket_set_nonblock(int fd) |
|
2137 |
{ |
|
2138 |
unsigned long opt = 1; |
|
2139 |
ioctlsocket(fd, FIONBIO, &opt); |
|
2140 |
} |
|
2141 |
|
|
2142 | 2133 |
#else |
2143 | 2134 |
|
2144 | 2135 |
static int unix_write(int fd, const uint8_t *buf, int len1) |
... | ... | |
2165 | 2156 |
{ |
2166 | 2157 |
return unix_write(fd, buf, len1); |
2167 | 2158 |
} |
2168 |
|
|
2169 |
void socket_set_nonblock(int fd) |
|
2170 |
{ |
|
2171 |
int f; |
|
2172 |
f = fcntl(fd, F_GETFL); |
|
2173 |
fcntl(fd, F_SETFL, f | O_NONBLOCK); |
|
2174 |
} |
|
2175 | 2159 |
#endif /* !_WIN32 */ |
2176 | 2160 |
|
2177 | 2161 |
#ifndef _WIN32 |
Also available in: Unified diff