unofficial mirror of libc-alpha@sourceware.org
 help / color / mirror / Atom feed
* [PATCH] Fix bits/socket.h SIOCGSTAMP* namespace issues
@ 2019-06-13  3:06 Vincent Chen
  2019-06-13  8:41 ` Florian Weimer
  0 siblings, 1 reply; 3+ messages in thread
From: Vincent Chen @ 2019-06-13  3:06 UTC (permalink / raw
  To: libc-alpha; +Cc: deanbo422, Vincent Chen

Macro SIOCGSTAMP_OLD and SIOCGSTAMPNS_OLD are added to asm/socket.h in
Linux 5.1 for 64-bit timestamps implementation.

sysdeps/unix/sysv/linux/bits/socket.h includes asm/socket.h. That
includes asm/sockios.h resulting in namespace violations from
SIOCGSTAMP_OLD and SIOCGSTAMPNS_OLD macros. Add these two macros to
workaound list in sysdeps/unix/sysv/linux/bits/socket.h like other
macros in asm/sockios.h.

Tested (compilation only) with build-many-glibcs.py.

        * sysdeps/unix/sysv/linux/bits/socket.h (SIOCGSTAMP_OLD): Undefine
        if defined by <asm/socket.h> and not previously defined.
        (SIOCGSTAMPNS_OLD): Likewise.
---
 ChangeLog                             |  6 ++++++
 sysdeps/unix/sysv/linux/bits/socket.h | 14 ++++++++++++++
 2 files changed, 20 insertions(+)

diff --git a/ChangeLog b/ChangeLog
index 2afedc1..63ed2ed 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2019-06-13  Vincent Chen  <vincentc@andestech.com>
+
+	* sysdeps/unix/sysv/linux/bits/socket.h (SIOCGSTAMP_OLD): Undefine
+	if defined by <asm/socket.h> and not previously defined.
+	(SIOCGSTAMPNS_OLD): Likewise.
+
 2019-06-12  Adhemerval Zanella  <adhemerval.zanella@linaro.org>
 
 	* sysdeps/powerpc/powerpc32/power4/fpu/multiarch/Makefile
diff --git a/sysdeps/unix/sysv/linux/bits/socket.h b/sysdeps/unix/sysv/linux/bits/socket.h
index 99af01d..4e5d58a 100644
--- a/sysdeps/unix/sysv/linux/bits/socket.h
+++ b/sysdeps/unix/sysv/linux/bits/socket.h
@@ -372,6 +372,12 @@ struct ucred
 # ifndef SIOCSPGRP
 #  define __SYS_SOCKET_H_undef_SIOCSPGRP
 # endif
+# ifndef SIOCGSTAMP_OLD
+#  define __SYS_SOCKET_H_undef_SIOCGSTAMP_OLD
+# endif
+# ifndef SIOCGSTAMPNS_OLD
+#  define __SYS_SOCKET_H_undef_SIOCGSTAMPNS_OLD
+# endif
 #endif
 #ifndef IOCSIZE_MASK
 # define __SYS_SOCKET_H_undef_IOCSIZE_MASK
@@ -421,6 +427,14 @@ struct ucred
 #  undef __SYS_SOCKET_H_undef_SIOCSPGRP
 #  undef SIOCSPGRP
 # endif
+# ifdef __SYS_SOCKET_H_undef_SIOCGSTAMP_OLD
+#  undef __SYS_SOCKET_H_undef_SIOCGSTAMP_OLD
+#  undef SIOCGSTAMP_OLD
+# endif
+# ifdef __SYS_SOCKET_H_undef_SIOCGSTAMPNS_OLD
+#  undef __SYS_SOCKET_H_undef_SIOCGSTAMPNS_OLD
+#  undef SIOCGSTAMPNS_OLD
+# endif
 #endif
 #ifdef __SYS_SOCKET_H_undef_IOCSIZE_MASK
 # undef __SYS_SOCKET_H_undef_IOCSIZE_MASK
-- 
1.9.5


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

* Re: [PATCH] Fix bits/socket.h SIOCGSTAMP* namespace issues
  2019-06-13  3:06 [PATCH] Fix bits/socket.h SIOCGSTAMP* namespace issues Vincent Chen
@ 2019-06-13  8:41 ` Florian Weimer
  2019-06-14  8:28   ` Vincent Chen
  0 siblings, 1 reply; 3+ messages in thread
From: Florian Weimer @ 2019-06-13  8:41 UTC (permalink / raw
  To: Vincent Chen; +Cc: libc-alpha, deanbo422

* Vincent Chen:

> Macro SIOCGSTAMP_OLD and SIOCGSTAMPNS_OLD are added to asm/socket.h in
> Linux 5.1 for 64-bit timestamps implementation.
>
> sysdeps/unix/sysv/linux/bits/socket.h includes asm/socket.h. That
> includes asm/sockios.h resulting in namespace violations from
> SIOCGSTAMP_OLD and SIOCGSTAMPNS_OLD macros. Add these two macros to
> workaound list in sysdeps/unix/sysv/linux/bits/socket.h like other
> macros in asm/sockios.h.

I wonder if it is time to copy the definitions we need for !_GNU_SOURCE
into the glibc source tree.  It would also address the recent namespace
cleanliness issue.  Only some architectures (alpha, mips, hppa, powerpc,
sparc) have custom definitions in the UAPI headers, it seems.  For
_GNU_SOURCE, we would still include <asm/socket.h>.

Or am I totally off about this and it doesn't make sense?

Would you want to work on this?  It requires a reasonably fast machine
for running build-many-glibcs.py.

Thanks,
Florian

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

* Re: [PATCH] Fix bits/socket.h SIOCGSTAMP* namespace issues
  2019-06-13  8:41 ` Florian Weimer
@ 2019-06-14  8:28   ` Vincent Chen
  0 siblings, 0 replies; 3+ messages in thread
From: Vincent Chen @ 2019-06-14  8:28 UTC (permalink / raw
  To: Florian Weimer; +Cc: libc-alpha@sourceware.org, deanbo422@gmail.com

On Thu, Jun 13, 2019 at 04:41:13PM +0800, Florian Weimer wrote:
> * Vincent Chen:
> 
> > Macro SIOCGSTAMP_OLD and SIOCGSTAMPNS_OLD are added to asm/socket.h in
> > Linux 5.1 for 64-bit timestamps implementation.
> >
> > sysdeps/unix/sysv/linux/bits/socket.h includes asm/socket.h. That
> > includes asm/sockios.h resulting in namespace violations from
> > SIOCGSTAMP_OLD and SIOCGSTAMPNS_OLD macros. Add these two macros to
> > workaound list in sysdeps/unix/sysv/linux/bits/socket.h like other
> > macros in asm/sockios.h.
> 
> I wonder if it is time to copy the definitions we need for !_GNU_SOURCE
> into the glibc source tree.  It would also address the recent namespace
> cleanliness issue.  Only some architectures (alpha, mips, hppa, powerpc,
> sparc) have custom definitions in the UAPI headers, it seems.  For
> _GNU_SOURCE, we would still include <asm/socket.h>.
> 
> Or am I totally off about this and it doesn't make sense?

I think your concerns are reasonable.

> Would you want to work on this?  It requires a reasonably fast machine
> for running build-many-glibcs.py.
>
Currently, I do not have enough resource to do this.
Hence, If anyone wants to work on this, I will be very grateful.


Thanks,
Vincent Chen

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

end of thread, other threads:[~2019-06-14  8:28 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-06-13  3:06 [PATCH] Fix bits/socket.h SIOCGSTAMP* namespace issues Vincent Chen
2019-06-13  8:41 ` Florian Weimer
2019-06-14  8:28   ` Vincent Chen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).