From: David Ahern Date: Thu, 2 May 2019 23:13:21 +0000 (-0700) Subject: uapi: wrap SIOCGSTAMP and SIOCGSTAMPNS in ifndef X-Git-Tag: v5.2.0~45^2~4 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=420b36a874b72bbe62feb2de903a705e7d177bd0;p=thirdparty%2Fiproute2.git uapi: wrap SIOCGSTAMP and SIOCGSTAMPNS in ifndef These warnings: ../include/uapi/linux/sockios.h:42:0: warning: "SIOCGSTAMP" redefined ../include/uapi/linux/sockios.h:43:0: warning: "SIOCGSTAMPNS" redefined are from kernel commit 0768e17073dc5 ("net: socket: implement 64-bit timestamps"). This commit moved the definitions of SIOCGSTAMP and SIOCGSTAMPNS from include/asm-generic/sockios.h to include/uapi/linux/sockios.h. Older OS'es already define them in /usr/include/asm-generic/sockios.h resulting in ugly compile errors now: In file included from ll_types.c:24:0: ../include/uapi/linux/sockios.h:42:0: warning: "SIOCGSTAMP" redefined #define SIOCGSTAMP SIOCGSTAMP_OLD In file included from /usr/include/x86_64-linux-gnu/asm/sockios.h:1:0, from /usr/include/asm-generic/socket.h:5, from /usr/include/x86_64-linux-gnu/asm/socket.h:1, from /usr/include/x86_64-linux-gnu/bits/socket.h:368, from /usr/include/x86_64-linux-gnu/sys/socket.h:38, from ll_types.c:17: /usr/include/asm-generic/sockios.h:11:0: note: this is the location of the previous definition #define SIOCGSTAMP 0x8906 /* Get stamp (timeval) */ so wrap them in #ifndef. Signed-off-by: David Ahern --- diff --git a/include/uapi/linux/sockios.h b/include/uapi/linux/sockios.h index 7d1bccbbe..35d7a60f9 100644 --- a/include/uapi/linux/sockios.h +++ b/include/uapi/linux/sockios.h @@ -39,8 +39,12 @@ #if __BITS_PER_LONG == 64 || (defined(__x86_64__) && defined(__ILP32__)) /* on 64-bit and x32, avoid the ?: operator */ +#ifndef SIOCGSTAMP #define SIOCGSTAMP SIOCGSTAMP_OLD +#endif +#ifndef SIOCGSTAMPNS #define SIOCGSTAMPNS SIOCGSTAMPNS_OLD +#endif #else #define SIOCGSTAMP ((sizeof(struct timeval)) == 8 ? \ SIOCGSTAMP_OLD : SIOCGSTAMP_NEW)