From 9549e764bdc24b085cb1bb87400bf6ef79ae9eb1 Mon Sep 17 00:00:00 2001 From: Jes Sorensen Date: Tue, 26 Oct 2010 10:39:20 +0200 Subject: Move osdep socket code to oslib-{posix,win32}.c Signed-off-by: Jes Sorensen Signed-off-by: Blue Swirl --- osdep.c | 38 -------------------------------------- 1 file changed, 38 deletions(-) (limited to 'osdep.c') diff --git a/osdep.c b/osdep.c index 581768a906..902fce94bb 100644 --- a/osdep.c +++ b/osdep.c @@ -147,44 +147,6 @@ int qemu_gettimeofday(qemu_timeval *tp) #endif /* _WIN32 */ -#ifdef _WIN32 -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) -{ -} - -#else - -void socket_set_nonblock(int fd) -{ - int f; - f = fcntl(fd, F_GETFL); - fcntl(fd, F_SETFL, f | O_NONBLOCK); -} - -void qemu_set_cloexec(int fd) -{ - int f; - f = fcntl(fd, F_GETFD); - fcntl(fd, F_SETFD, f | FD_CLOEXEC); -} - -#endif - /* * Opens a file with FD_CLOEXEC set */ -- cgit v1.2.1