From 40ff6d7e8dceca227e7f8a3e8e0d58b2c66d19b4 Mon Sep 17 00:00:00 2001 From: Kevin Wolf Date: Wed, 2 Dec 2009 12:24:42 +0100 Subject: Don't leak file descriptors We're leaking file descriptors to child processes. Set FD_CLOEXEC on file descriptors that don't need to be passed to children to stop this misbehaviour. Signed-off-by: Kevin Wolf Signed-off-by: Anthony Liguori --- qemu-common.h | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'qemu-common.h') diff --git a/qemu-common.h b/qemu-common.h index 57af677..8630f8c 100644 --- a/qemu-common.h +++ b/qemu-common.h @@ -159,6 +159,13 @@ void *get_mmap_addr(unsigned long size); void qemu_mutex_lock_iothread(void); void qemu_mutex_unlock_iothread(void); +int qemu_open(const char *name, int flags, ...); +void qemu_set_cloexec(int fd); + +#ifndef _WIN32 +int qemu_pipe(int pipefd[2]); +#endif + /* Error handling. */ void QEMU_NORETURN hw_error(const char *fmt, ...) -- cgit v1.1