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

Daniel P. Berrange posted 1 patch 6 years, 10 months ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/libvirt tags/patchew/20170614133927.10432-1-berrange@redhat.com
configure.ac      | 2 +-
src/util/virlog.c | 3 +++
2 files changed, 4 insertions(+), 1 deletion(-)
[libvirt] [PATCH] Use sys/uio.h for writev()
Posted by Daniel P. Berrange 6 years, 10 months ago
With glibc >= 2.25.90 writev() is only available if you explicitly
include sys/uio.h

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
---

A build breaker, but not yet pushed in case anyone has opinions...

 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@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list
Re: [libvirt] [PATCH] Use sys/uio.h for writev()
Posted by Martin Kletzander 6 years, 10 months ago
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@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@redhat.com
>https://www.redhat.com/mailman/listinfo/libvir-list
--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list
Re: [libvirt] [PATCH] Use sys/uio.h for writev()
Posted by Daniel P. Berrange 6 years, 10 months ago
On Wed, Jun 14, 2017 at 03:50:22PM +0200, Martin Kletzander wrote:
> 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@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.

Oh I added the conditional because its missing in Mingw, but I forgot
that gnulib fixes that for us. So yeah, I'll remove the conditional.

Regards,
Daniel
-- 
|: https://berrange.com      -o-    https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org         -o-            https://fstop138.berrange.com :|
|: https://entangle-photo.org    -o-    https://www.instagram.com/dberrange :|

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list