Move osdep socket code to oslib-{posix,win32}.c

Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
This commit is contained in:
Jes Sorensen 2010-10-26 10:39:20 +02:00 committed by Blue Swirl
parent c1b0b93b06
commit 9549e764bd
3 changed files with 36 additions and 38 deletions

View file

@ -29,6 +29,7 @@
#include "config-host.h"
#include "sysemu.h"
#include "trace.h"
#include "qemu_socket.h"
static void *oom_check(void *ptr)
{
@ -71,3 +72,23 @@ void qemu_vfree(void *ptr)
trace_qemu_vfree(ptr);
VirtualFree(ptr, 0, MEM_RELEASE);
}
void socket_set_nonblock(int fd)
{
unsigned long opt = 1;
ioctlsocket(fd, FIONBIO, &opt);
}
int inet_aton(const char *cp, struct in_addr *ia)
{
uint32_t addr = inet_addr(cp);
if (addr == 0xffffffff) {
return 0;
}
ia->s_addr = addr;
return 1;
}
void qemu_set_cloexec(int fd)
{
}