All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] tools: include sys/sysmacros.h on Linux
@ 2017-03-14  7:37 Olaf Hering
  2017-03-14 11:43 ` Wei Liu
  0 siblings, 1 reply; 5+ messages in thread
From: Olaf Hering @ 2017-03-14  7:37 UTC (permalink / raw)
  To: xen-devel; +Cc: Wei Liu, Olaf Hering, Ian Jackson

Due to a bug in the glibc headers the macros makedev(), major() and
minor() where avaialble by including sys/types.h. This bug was
addressed in glibc-2.25 by introducing a warning when these macros are
used. Since Xen is build with -Werror this new warning cause a compile
error.

Use sys/sysmacros.h to define these three macros.

blktap2 is already Linux specific. The kernel header which was used to
get makedev() does not provided it anymore, and it was wrong to use a
kernel header anyway.

Signed-off-by: Olaf Hering <olaf@aepfle.de>
---
 tools/blktap2/control/tap-ctl-allocate.c | 2 +-
 tools/libxl/libxl_osdeps.h               | 1 +
 2 files changed, 2 insertions(+), 1 deletion(-)

diff --git a/tools/blktap2/control/tap-ctl-allocate.c b/tools/blktap2/control/tap-ctl-allocate.c
index 8a6471e987..908c87f305 100644
--- a/tools/blktap2/control/tap-ctl-allocate.c
+++ b/tools/blktap2/control/tap-ctl-allocate.c
@@ -36,7 +36,7 @@
 #include <sys/stat.h>
 #include <sys/types.h>
 #include <sys/ioctl.h>
-#include <linux/major.h>
+#include <sys/sysmacros.h>
 
 #include "tap-ctl.h"
 #include "blktap2.h"
diff --git a/tools/libxl/libxl_osdeps.h b/tools/libxl/libxl_osdeps.h
index a40d62066b..de1d24ecae 100644
--- a/tools/libxl/libxl_osdeps.h
+++ b/tools/libxl/libxl_osdeps.h
@@ -39,6 +39,7 @@
 #define SYSFS_PCI_DEV          "/sys/bus/pci/devices"
 #define SYSFS_PCIBACK_DRIVER   "/sys/bus/pci/drivers/pciback"
 #define NETBACK_NIC_NAME       "vif%u.%d"
+#include <sys/sysmacros.h>
 #include <pty.h>
 #include <uuid/uuid.h>
 #elif defined(__sun__)

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH] tools: include sys/sysmacros.h on Linux
  2017-03-14  7:37 [PATCH] tools: include sys/sysmacros.h on Linux Olaf Hering
@ 2017-03-14 11:43 ` Wei Liu
  2017-03-14 11:54   ` Wei Liu
  0 siblings, 1 reply; 5+ messages in thread
From: Wei Liu @ 2017-03-14 11:43 UTC (permalink / raw)
  To: Olaf Hering; +Cc: Wei Liu, Ian Jackson, xen-devel

On Tue, Mar 14, 2017 at 07:37:04AM +0000, Olaf Hering wrote:
> Due to a bug in the glibc headers the macros makedev(), major() and
> minor() where avaialble by including sys/types.h. This bug was
> addressed in glibc-2.25 by introducing a warning when these macros are
> used. Since Xen is build with -Werror this new warning cause a compile
> error.
> 
> Use sys/sysmacros.h to define these three macros.
> 
> blktap2 is already Linux specific. The kernel header which was used to
> get makedev() does not provided it anymore, and it was wrong to use a
> kernel header anyway.
> 
> Signed-off-by: Olaf Hering <olaf@aepfle.de>

Acked-by: Wei Liu <wei.liu2@citrix.com>

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] tools: include sys/sysmacros.h on Linux
  2017-03-14 11:43 ` Wei Liu
@ 2017-03-14 11:54   ` Wei Liu
  2017-03-14 12:08     ` Olaf Hering
  0 siblings, 1 reply; 5+ messages in thread
From: Wei Liu @ 2017-03-14 11:54 UTC (permalink / raw)
  To: Olaf Hering; +Cc: Wei Liu, Ian Jackson, xen-devel

On Tue, Mar 14, 2017 at 11:43:09AM +0000, Wei Liu wrote:
> On Tue, Mar 14, 2017 at 07:37:04AM +0000, Olaf Hering wrote:
> > Due to a bug in the glibc headers the macros makedev(), major() and
> > minor() where avaialble by including sys/types.h. This bug was
> > addressed in glibc-2.25 by introducing a warning when these macros are
> > used. Since Xen is build with -Werror this new warning cause a compile
> > error.
> > 
> > Use sys/sysmacros.h to define these three macros.
> > 
> > blktap2 is already Linux specific. The kernel header which was used to
> > get makedev() does not provided it anymore, and it was wrong to use a
> > kernel header anyway.
> > 
> > Signed-off-by: Olaf Hering <olaf@aepfle.de>
> 
> Acked-by: Wei Liu <wei.liu2@citrix.com>

Got this while compiling on Debian Stretch:

tap-ctl-allocate.c: In function ‘tap_ctl_check_environment’:
tap-ctl-allocate.c:143:9: error: ‘MISC_MAJOR’ undeclared (first use in
this function)
         MISC_MAJOR,
         ^~~~~~~~~~
tap-ctl-allocate.c:143:9: note: each undeclared identifier is reported
only once for each 
function it appears in
/local/work/COMMITTER/xen.git/tools/blktap2/control/../../..//tools/Rules.mk:212:
recipe f
or target 'tap-ctl-allocate.opic' failed
make[5]: *** [tap-ctl-allocate.opic] Error 1

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] tools: include sys/sysmacros.h on Linux
  2017-03-14 11:54   ` Wei Liu
@ 2017-03-14 12:08     ` Olaf Hering
  2017-03-14 12:10       ` Wei Liu
  0 siblings, 1 reply; 5+ messages in thread
From: Olaf Hering @ 2017-03-14 12:08 UTC (permalink / raw)
  To: Wei Liu; +Cc: Ian Jackson, xen-devel


[-- Attachment #1.1: Type: text/plain, Size: 310 bytes --]

Am Tue, 14 Mar 2017 11:54:46 +0000
schrieb Wei Liu <wei.liu2@citrix.com>:

> tap-ctl-allocate.c:143:9: error: ‘MISC_MAJOR’ undeclared (first use in

That happened because the variant of the change I sent was untested...
I will revisit this part. sys/types.h is needed according to mknod(2).

Olaf

[-- Attachment #1.2: Digitale Signatur von OpenPGP --]
[-- Type: application/pgp-signature, Size: 195 bytes --]

[-- Attachment #2: Type: text/plain, Size: 127 bytes --]

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] tools: include sys/sysmacros.h on Linux
  2017-03-14 12:08     ` Olaf Hering
@ 2017-03-14 12:10       ` Wei Liu
  0 siblings, 0 replies; 5+ messages in thread
From: Wei Liu @ 2017-03-14 12:10 UTC (permalink / raw)
  To: Olaf Hering; +Cc: Ian Jackson, Wei Liu, xen-devel

On Tue, Mar 14, 2017 at 01:08:28PM +0100, Olaf Hering wrote:
> Am Tue, 14 Mar 2017 11:54:46 +0000
> schrieb Wei Liu <wei.liu2@citrix.com>:
> 
> > tap-ctl-allocate.c:143:9: error: ‘MISC_MAJOR’ undeclared (first use in
> 
> That happened because the variant of the change I sent was untested...
> I will revisit this part. sys/types.h is needed according to mknod(2).
> 

Right, please send an updated version. :-)

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2017-03-14 12:10 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-03-14  7:37 [PATCH] tools: include sys/sysmacros.h on Linux Olaf Hering
2017-03-14 11:43 ` Wei Liu
2017-03-14 11:54   ` Wei Liu
2017-03-14 12:08     ` Olaf Hering
2017-03-14 12:10       ` Wei Liu

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.