[libvirt] [PATCH] Use sys/uio.h for writev()

Martin Kletzander mkletzan at redhat.com
Wed Jun 14 13:50:22 UTC 2017


On Wed, Jun 14, 2017 at 02:39:27PM +0100, Daniel P. Berrange wrote:
>With glibc >= 2.25.90 writev() is only available if you explicitly
>include sys/uio.h
>
>Signed-off-by: Daniel P. Berrange <berrange at redhat.com>
>---
>
>A build breaker, but not yet pushed in case anyone has opinions...
>

Even older ones require that, actually, so we should've done that even
before.  I'm not sure we need to include it conditionally, but ACK to
this version.

> configure.ac      | 2 +-
> src/util/virlog.c | 3 +++
> 2 files changed, 4 insertions(+), 1 deletion(-)
>
>diff --git a/configure.ac b/configure.ac
>index 1a73b34..1a48bb0 100644
>--- a/configure.ac
>+++ b/configure.ac
>@@ -328,7 +328,7 @@ dnl Availability of various common headers (non-fatal if missing).
> AC_CHECK_HEADERS([pwd.h regex.h sys/un.h \
>   sys/poll.h syslog.h mntent.h net/ethernet.h linux/magic.h \
>   sys/un.h sys/syscall.h sys/sysctl.h netinet/tcp.h ifaddrs.h \
>-  libtasn1.h sys/ucred.h sys/mount.h stdarg.h])
>+  libtasn1.h sys/ucred.h sys/mount.h stdarg.h sys/uio.h])
> dnl Check whether endian provides handy macros.
> AC_CHECK_DECLS([htole64], [], [], [[#include <endian.h>]])
> AC_CHECK_FUNCS([stat stat64 __xstat __xstat64 lstat lstat64 __lxstat __lxstat64])
>diff --git a/src/util/virlog.c b/src/util/virlog.c
>index 7933e1a..3a28e5e 100644
>--- a/src/util/virlog.c
>+++ b/src/util/virlog.c
>@@ -32,6 +32,9 @@
> #include <unistd.h>
> #include <execinfo.h>
> #include <regex.h>
>+#if HAVE_SYS_UIO_H
>+# include <sys/uio.h>
>+#endif
> #if HAVE_SYSLOG_H
> # include <syslog.h>
> #endif
>--
>2.9.3
>
>--
>libvir-list mailing list
>libvir-list at redhat.com
>https://www.redhat.com/mailman/listinfo/libvir-list
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: Digital signature
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20170614/6b5ad5dc/attachment-0001.sig>


More information about the libvir-list mailing list