diff options
Diffstat (limited to 'util')
-rw-r--r-- | util/compatfd.c | 19 | ||||
-rw-r--r-- | util/osdep.c | 66 |
2 files changed, 0 insertions, 85 deletions
diff --git a/util/compatfd.c b/util/compatfd.c index 341ada638f..e8571502be 100644 --- a/util/compatfd.c +++ b/util/compatfd.c @@ -108,22 +108,3 @@ int qemu_signalfd(const sigset_t *mask) return qemu_signalfd_compat(mask); } - -bool qemu_signalfd_available(void) -{ -#ifdef CONFIG_SIGNALFD - sigset_t mask; - int fd; - bool ok; - sigemptyset(&mask); - errno = 0; - fd = syscall(SYS_signalfd, -1, &mask, _NSIG / 8); - ok = (errno != ENOSYS); - if (fd >= 0) { - close(fd); - } - return ok; -#else - return false; -#endif -} diff --git a/util/osdep.c b/util/osdep.c index b2bd1542c5..f938b69466 100644 --- a/util/osdep.c +++ b/util/osdep.c @@ -310,72 +310,6 @@ int qemu_accept(int s, struct sockaddr *addr, socklen_t *addrlen) return ret; } -/* - * A variant of send(2) which handles partial write. - * - * Return the number of bytes transferred, which is only - * smaller than `count' if there is an error. - * - * This function won't work with non-blocking fd's. - * Any of the possibilities with non-bloking fd's is bad: - * - return a short write (then name is wrong) - * - busy wait adding (errno == EAGAIN) to the loop - */ -ssize_t qemu_send_full(int fd, const void *buf, size_t count, int flags) -{ - ssize_t ret = 0; - ssize_t total = 0; - - while (count) { - ret = send(fd, buf, count, flags); - if (ret < 0) { - if (errno == EINTR) { - continue; - } - break; - } - - count -= ret; - buf += ret; - total += ret; - } - - return total; -} - -/* - * A variant of recv(2) which handles partial write. - * - * Return the number of bytes transferred, which is only - * smaller than `count' if there is an error. - * - * This function won't work with non-blocking fd's. - * Any of the possibilities with non-bloking fd's is bad: - * - return a short write (then name is wrong) - * - busy wait adding (errno == EAGAIN) to the loop - */ -ssize_t qemu_recv_full(int fd, void *buf, size_t count, int flags) -{ - ssize_t ret = 0; - ssize_t total = 0; - - while (count) { - ret = qemu_recv(fd, buf, count, flags); - if (ret <= 0) { - if (ret < 0 && errno == EINTR) { - continue; - } - break; - } - - count -= ret; - buf += ret; - total += ret; - } - - return total; -} - void qemu_set_version(const char *version) { qemu_version = version; |