@@ -554,6 +554,7 @@ static inline void qemu_timersub(const struct timeval *val1,
#endif
void qemu_set_cloexec(int fd);
+void qemu_clr_cloexec(int fd);
/* Starting on QEMU 2.5, qemu_hw_version() returns "2.5+" by default
* instead of QEMU_VERSION, so setting hw_version on MachineClass
@@ -314,6 +314,15 @@ void qemu_set_cloexec(int fd)
assert(f != -1);
}
+void qemu_clr_cloexec(int fd)
+{
+ int f;
+ f = fcntl(fd, F_GETFD);
+ assert(f != -1);
+ f = fcntl(fd, F_SETFD, f & ~FD_CLOEXEC);
+ assert(f != -1);
+}
+
/*
* Creates a pipe with FD_CLOEXEC set on both file descriptors
*/
@@ -254,6 +254,10 @@ void qemu_set_cloexec(int fd)
{
}
+void qemu_clr_cloexec(int fd)
+{
+}
+
/* Offset between 1/1/1601 and 1/1/1970 in 100 nanosec units */
#define _W32_FT_OFFSET (116444736000000000ULL)