From 420b36a874b72bbe62feb2de903a705e7d177bd0 Mon Sep 17 00:00:00 2001 From: David Ahern Date: Thu, 2 May 2019 16:13:21 -0700 Subject: [PATCH] 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 --- include/uapi/linux/sockios.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/include/uapi/linux/sockios.h b/include/uapi/linux/sockios.h index 7d1bccbb..35d7a60f 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)