From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754711AbcHZPm4 (ORCPT ); Fri, 26 Aug 2016 11:42:56 -0400 Received: from mx01-fr.bfs.de ([193.174.231.67]:37960 "EHLO mx01-fr.bfs.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752760AbcHZPi0 (ORCPT ); Fri, 26 Aug 2016 11:38:26 -0400 Message-ID: <57C06258.8000807@bfs.de> Date: Fri, 26 Aug 2016 17:38:00 +0200 From: walter harms Reply-To: wharms@bfs.de User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; de; rv:1.9.1.16) Gecko/20101125 SUSE/3.0.11 Thunderbird/3.0.11 MIME-Version: 1.0 To: Mikko Rapeli CC: linux-kernel@vger.kernel.org, linux-hams@vger.kernel.org Subject: Re: [PATCH v05 69/72] uapi rose.h: glibc netrose/rose.h header file compatibility fixes References: <1471890809-4383-1-git-send-email-mikko.rapeli@iki.fi> <1471890809-4383-70-git-send-email-mikko.rapeli@iki.fi> In-Reply-To: <1471890809-4383-70-git-send-email-mikko.rapeli@iki.fi> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org perhaps this not tested snipped would make sure that you have included linux/rose.h ? #ifndef ROSE_KERNEL_H #include #endif #include re, wh Am 22.08.2016 20:33, schrieb Mikko Rapeli: > Fixes these userspace compile errors and warnings when glibc > netrose/rose.h is included before linux/rose.h: > > linux/rose.h:25:0: warning: "SIOCRSGCAUSE" redefined > linux/rose.h:26:0: warning: "SIOCRSSCAUSE" redefined > linux/rose.h:27:0: warning: "SIOCRSL2CALL" redefined > linux/rose.h:28:0: warning: "SIOCRSSL2CALL" redefined > linux/rose.h:29:0: warning: "SIOCRSACCEPT" redefined > linux/rose.h:30:0: warning: "SIOCRSCLRRT" redefined > linux/rose.h:31:0: warning: "SIOCRSGL2CALL" redefined > linux/rose.h:32:0: warning: "SIOCRSGFACILITIES" redefined > linux/rose.h:47:3: error: conflicting types for ‘rose_address’ > linux/rose.h:49:8: error: redefinition of ‘struct sockaddr_rose’ > linux/rose.h:57:8: error: redefinition of ‘struct full_sockaddr_rose’ > linux/rose.h:65:8: error: redefinition of ‘struct rose_route_struct’ > linux/rose.h:74:8: error: redefinition of ‘struct rose_cause_struct’ > linux/rose.h:79:8: error: redefinition of ‘struct rose_facilities_struct’ > > Signed-off-by: Mikko Rapeli > --- > include/uapi/linux/libc-compat.h | 30 ++++++++++++++++++++++++++++++ > include/uapi/linux/rose.h | 15 +++++++++++++++ > 2 files changed, 45 insertions(+) > > diff --git a/include/uapi/linux/libc-compat.h b/include/uapi/linux/libc-compat.h > index 01bb521..acc2e75 100644 > --- a/include/uapi/linux/libc-compat.h > +++ b/include/uapi/linux/libc-compat.h > @@ -209,6 +209,27 @@ > > #endif /* defined(__NETIPX_IPX_H) */ > > +/* Coordinate with glibc netrose/rose.h */ > +#if defined(_NETROSE_ROSE_H) > +#define __UAPI_DEF_SIOCRSGCAUSE_TO_SIOCRSGFACILITIES 0 > +#define __UAPI_DEF_ROSE_ADDRESS 0 > +#define __UAPI_DEF_SOCKADDR_ROSE 0 > +#define __UAPI_DEF_FULL_SOCKADDR_ROSE 0 > +#define __UAPI_DEF_ROSE_ROUTE_STRUCT 0 > +#define __UAPI_DEF_ROSE_CAUSE_STRUCT 0 > +#define __UAPI_DEF_ROSE_FACILITIES_STRUCT 0 > + > +#else /* defined(_NETROSE_ROSE_H) */ > +#define __UAPI_DEF_SIOCRSGCAUSE_TO_SIOCRSGFACILITIES 1 > +#define __UAPI_DEF_ROSE_ADDRESS 1 > +#define __UAPI_DEF_SOCKADDR_ROSE 1 > +#define __UAPI_DEF_FULL_SOCKADDR_ROSE 1 > +#define __UAPI_DEF_ROSE_ROUTE_STRUCT 1 > +#define __UAPI_DEF_ROSE_CAUSE_STRUCT 1 > +#define __UAPI_DEF_ROSE_FACILITIES_STRUCT 1 > + > +#endif /* defined(_NETROSE_ROSE_H) */ > + > /* Definitions for sys/uio.h */ > #if defined(_SYS_UIO_H) > #define __UAPI_DEF_IOVEC 0 > @@ -283,6 +304,15 @@ > #define __UAPI_DEF_IPX_CONFIG_DATA 1 > #define __UAPI_DEF_IPX_ROUTE_DEF 1 > > +/* Definitions for rose.h */ > +#define __UAPI_DEF_SIOCRSGCAUSE_TO_SIOCRSGFACILITIES 1 > +#define __UAPI_DEF_ROSE_ADDRESS 1 > +#define __UAPI_DEF_SOCKADDR_ROSE 1 > +#define __UAPI_DEF_FULL_SOCKADDR_ROSE 1 > +#define __UAPI_DEF_ROSE_ROUTE_STRUCT 1 > +#define __UAPI_DEF_ROSE_CAUSE_STRUCT 1 > +#define __UAPI_DEF_ROSE_FACILITIES_STRUCT 1 > + > /* Definitions for uio.h */ > #define __UAPI_DEF_IOVEC 1 > > diff --git a/include/uapi/linux/rose.h b/include/uapi/linux/rose.h > index 1fcfe95..c39499c 100644 > --- a/include/uapi/linux/rose.h > +++ b/include/uapi/linux/rose.h > @@ -7,6 +7,7 @@ > #ifndef ROSE_KERNEL_H > #define ROSE_KERNEL_H > > +#include > #include > #include > > @@ -22,6 +23,7 @@ > #define ROSE_QBITINCL 6 > #define ROSE_HOLDBACK 7 > > +#if __UAPI_DEF_SIOCRSGCAUSE_TO_SIOCRSGFACILITIES > #define SIOCRSGCAUSE (SIOCPROTOPRIVATE+0) > #define SIOCRSSCAUSE (SIOCPROTOPRIVATE+1) > #define SIOCRSL2CALL (SIOCPROTOPRIVATE+2) > @@ -30,6 +32,7 @@ > #define SIOCRSCLRRT (SIOCPROTOPRIVATE+4) > #define SIOCRSGL2CALL (SIOCPROTOPRIVATE+5) > #define SIOCRSGFACILITIES (SIOCPROTOPRIVATE+6) > +#endif /* __UAPI_DEF_SIOCRSGCAUSE_TO_SIOCRSGFACILITIES */ > > #define ROSE_DTE_ORIGINATED 0x00 > #define ROSE_NUMBER_BUSY 0x01 > @@ -42,10 +45,13 @@ > #define ROSE_LOCAL_PROCEDURE 0x13 > #define ROSE_SHIP_ABSENT 0x39 > > +#if __UAPI_DEF_ROSE_ADDRESS > typedef struct { > char rose_addr[5]; > } rose_address; > +#endif /* __UAPI_DEF_ROSE_ADDRESS */ > > +#if __UAPI_DEF_SOCKADDR_ROSE > struct sockaddr_rose { > __kernel_sa_family_t srose_family; > rose_address srose_addr; > @@ -53,7 +59,9 @@ struct sockaddr_rose { > int srose_ndigis; > ax25_address srose_digi; > }; > +#endif /* __UAPI_DEF_SOCKADDR_ROSE */ > > +#if __UAPI_DEF_FULL_SOCKADDR_ROSE > struct full_sockaddr_rose { > __kernel_sa_family_t srose_family; > rose_address srose_addr; > @@ -61,7 +69,9 @@ struct full_sockaddr_rose { > unsigned int srose_ndigis; > ax25_address srose_digis[ROSE_MAX_DIGIS]; > }; > +#endif /* __UAPI_DEF_FULL_SOCKADDR_ROSE */ > > +#if __UAPI_DEF_ROSE_ROUTE_STRUCT > struct rose_route_struct { > rose_address address; > unsigned short mask; > @@ -70,12 +80,16 @@ struct rose_route_struct { > unsigned char ndigis; > ax25_address digipeaters[AX25_MAX_DIGIS]; > }; > +#endif /* __UAPI_DEF_ROSE_ROUTE_STRUCT */ > > +#if __UAPI_DEF_ROSE_CAUSE_STRUCT > struct rose_cause_struct { > unsigned char cause; > unsigned char diagnostic; > }; > +#endif /* __UAPI_DEF_ROSE_CAUSE_STRUCT */ > > +#if __UAPI_DEF_ROSE_FACILITIES_STRUCT > struct rose_facilities_struct { > rose_address source_addr, dest_addr; > ax25_address source_call, dest_call; > @@ -86,5 +100,6 @@ struct rose_facilities_struct { > rose_address fail_addr; > ax25_address fail_call; > }; > +#endif /* __UAPI_DEF_ROSE_FACILITIES_STRUCT */ > > #endif