mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-12-17 21:26:13 -07:00
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:
parent
c1b0b93b06
commit
9549e764bd
3 changed files with 36 additions and 38 deletions
|
|
@ -29,6 +29,7 @@
|
|||
#include "config-host.h"
|
||||
#include "sysemu.h"
|
||||
#include "trace.h"
|
||||
#include "qemu_socket.h"
|
||||
|
||||
#if !defined(_POSIX_C_SOURCE) || defined(__sun__)
|
||||
static void *oom_check(void *ptr)
|
||||
|
|
@ -72,3 +73,17 @@ void qemu_vfree(void *ptr)
|
|||
trace_qemu_vfree(ptr);
|
||||
free(ptr);
|
||||
}
|
||||
|
||||
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);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue