Loading osdep.c +0 −22 Original line number Diff line number Diff line Loading @@ -235,28 +235,6 @@ int qemu_eventfd(int fds[2]) return qemu_pipe(fds); } /* * Creates a pipe with FD_CLOEXEC set on both file descriptors */ int qemu_pipe(int pipefd[2]) { int ret; #ifdef CONFIG_PIPE2 ret = pipe2(pipefd, O_CLOEXEC); if (ret != -1 || errno != ENOSYS) { return ret; } #endif ret = pipe(pipefd); if (ret == 0) { qemu_set_cloexec(pipefd[0]); qemu_set_cloexec(pipefd[1]); } return ret; } #endif /* Loading oslib-posix.c +22 −0 Original line number Diff line number Diff line Loading @@ -87,3 +87,25 @@ void qemu_set_cloexec(int fd) f = fcntl(fd, F_GETFD); fcntl(fd, F_SETFD, f | FD_CLOEXEC); } /* * Creates a pipe with FD_CLOEXEC set on both file descriptors */ int qemu_pipe(int pipefd[2]) { int ret; #ifdef CONFIG_PIPE2 ret = pipe2(pipefd, O_CLOEXEC); if (ret != -1 || errno != ENOSYS) { return ret; } #endif ret = pipe(pipefd); if (ret == 0) { qemu_set_cloexec(pipefd[0]); qemu_set_cloexec(pipefd[1]); } return ret; } Loading
osdep.c +0 −22 Original line number Diff line number Diff line Loading @@ -235,28 +235,6 @@ int qemu_eventfd(int fds[2]) return qemu_pipe(fds); } /* * Creates a pipe with FD_CLOEXEC set on both file descriptors */ int qemu_pipe(int pipefd[2]) { int ret; #ifdef CONFIG_PIPE2 ret = pipe2(pipefd, O_CLOEXEC); if (ret != -1 || errno != ENOSYS) { return ret; } #endif ret = pipe(pipefd); if (ret == 0) { qemu_set_cloexec(pipefd[0]); qemu_set_cloexec(pipefd[1]); } return ret; } #endif /* Loading
oslib-posix.c +22 −0 Original line number Diff line number Diff line Loading @@ -87,3 +87,25 @@ void qemu_set_cloexec(int fd) f = fcntl(fd, F_GETFD); fcntl(fd, F_SETFD, f | FD_CLOEXEC); } /* * Creates a pipe with FD_CLOEXEC set on both file descriptors */ int qemu_pipe(int pipefd[2]) { int ret; #ifdef CONFIG_PIPE2 ret = pipe2(pipefd, O_CLOEXEC); if (ret != -1 || errno != ENOSYS) { return ret; } #endif ret = pipe(pipefd); if (ret == 0) { qemu_set_cloexec(pipefd[0]); qemu_set_cloexec(pipefd[1]); } return ret; }