[libvirt] [PATCH] Include sysmacros.h where needed

Daniel P. Berrange berrange at redhat.com
Thu Apr 14 14:30:44 UTC 2016


On Thu, Apr 14, 2016 at 04:14:23PM +0200, Martin Kletzander wrote:
> So in glibc-2.23 sys/sysmacros.h is no longer included from sys/types.h
> and we don't build because of the usage of major/minor/makedev macros.
> Simply add sys/sysmacros.h into files that are using any of these
> macros.
> 
> Signed-off-by: Martin Kletzander <mkletzan at redhat.com>
> ---
> I noticed this after update to glibc-2.23 and don't worry, there are
> more project that fail compiling due to the same issue.
> 
> I can't find it in their repository, but I think it's safe to assume
> that stuff will break sooner or later if we don't fix it.  The closest
> thing I've found is this thread:
> 
>   https://marc.info/?l=glibc-alpha&m=144790641508520
> 
> >From that mailing list thread (actually just one mesage I've found out,
> I haven't read the whole thread) there should've been some deprecation
> warning for few releases, but apparently there isn't.
> 
> Technically it's a build-breaker fix, but I'm sending it for review in
> case there is a system that does not have sys/sysmacros.h installed
> for some reason.  Then we'd have to resort to using AC_HEADER_MAJOR.

sys/sysmacros.h appears to be a glibc invention, so any other
platforms would break frm this - eg mingw, *bsd, os-x.

I think requiring sys/sysmacros.h is pretty dubious since the
man page for major, minor & makedev is saying you should be
using sys/types.h to get them.

Finally, I think this is the kind of thing that is gnulib's
role to address.


Regards,
Daniel
-- 
|: http://berrange.com      -o-    http://www.flickr.com/photos/dberrange/ :|
|: http://libvirt.org              -o-             http://virt-manager.org :|
|: http://autobuild.org       -o-         http://search.cpan.org/~danberr/ :|
|: http://entangle-photo.org       -o-       http://live.gnome.org/gtk-vnc :|




More information about the libvir-list mailing list