This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] Assume that accept4 is available


On 04/19/2017 04:53 PM, Joseph Myers wrote:
On Fri, 14 Apr 2017, Florian Weimer wrote:

diff --git a/sysdeps/unix/sysv/linux/kernel-features.h b/sysdeps/unix/sysv/linux/kernel-features.h
index fd936c5..b981466 100644
--- a/sysdeps/unix/sysv/linux/kernel-features.h
+++ b/sysdeps/unix/sysv/linux/kernel-features.h
@@ -75,18 +75,11 @@
     architectures using a separate syscall rather than socketcall that
     syscall was only added later, and some architectures first had
     socketcall support then a separate syscall.  Define
-   __ASSUME_ACCEPT4_SOCKETCALL if glibc uses socketcall on this
-   architecture and accept4 is available through socketcall,
     __ASSUME_ACCEPT4_SYSCALL if it is available through a separate
-   syscall, __ASSUME_ACCEPT4_SYSCALL_WITH_SOCKETCALL if it became
+   syscall, and __ASSUME_ACCEPT4_SYSCALL_WITH_SOCKETCALL if it became
     available through a separate syscall at the same time as through
-   socketcall, and __ASSUME_ACCEPT4 if the accept4 function is known
-   to work.  */
-#ifdef __ASSUME_SOCKETCALL
-# define __ASSUME_ACCEPT4_SOCKETCALL	1
-#endif
+   socketcall.  */
  #define __ASSUME_ACCEPT4_SYSCALL	1
-#define __ASSUME_ACCEPT4	1
/* Support for the FUTEX_CLOCK_REALTIME flag was added in 2.6.29. */
  #define __ASSUME_FUTEX_CLOCK_REALTIME	1

By removing the description and definition of __ASSUME_ACCEPT4_SOCKETCALL,
this loses the information about what __ASSUME_RECVMMSG_SOCKETCALL and
__ASSUME_SENDMMSG_SOCKETCALL mean, since the comments on the macros for
recvmmsg and sendmmsg define them by reference to the corresponding macros
for accept4.

Sorry about that.  Should we restore the comment with the attached patch?

Thanks,
Florian
Linux: Restore commetions in <kernel-features.h>

2017-04-20  Florian Weimer  <fweimer@redhat.com>

	* sysdeps/unix/sysv/linux/kernel-features.h: Restore the full
	*ACCEPT4* macro documentation and apply it to the *RECVMMSG*
	macros.

diff --git a/sysdeps/unix/sysv/linux/kernel-features.h b/sysdeps/unix/sysv/linux/kernel-features.h
index b981466..f02b602 100644
--- a/sysdeps/unix/sysv/linux/kernel-features.h
+++ b/sysdeps/unix/sysv/linux/kernel-features.h
@@ -88,8 +88,17 @@
 #define __ASSUME_PREADV	1
 #define __ASSUME_PWRITEV	1
 
-/* Support for recvmmsg functionality was added in 2.6.33.  The macros
-   defined correspond to those for accept4.  */
+/* Support for recvmmsg functionality was added in 2.6.33, but for
+   some architectures using a separate syscall rather than socketcall
+   that syscall was only added later, and some architectures first had
+   socketcall support then a separate syscall.  Define
+   __ASSUME_RECVMMSG_SOCKETCALL if glibc uses socketcall on this
+   architecture and recvmmsg is available through socketcall,
+   __ASSUME_RECVMMSG_SYSCALL if it is available through a separate
+   syscall, __ASSUME_RECVMMSG_SYSCALL_WITH_SOCKETCALL if it became
+   available through a separate syscall at the same time as through
+   socketcall, and __ASSUME_RECVMMSG if the recvmmsg function is known
+   to work.  */
 #if __LINUX_KERNEL_VERSION >= 0x020621
 # ifdef __ASSUME_SOCKETCALL
 #  define __ASSUME_RECVMMSG_SOCKETCALL	1
@@ -115,7 +124,7 @@
 #endif
 
 /* Support for sendmmsg functionality was added in 3.0.  The macros
-   defined correspond to those for accept4 and recvmmsg.  */
+   defined correspond to those for recvmmsg.  */
 #if __LINUX_KERNEL_VERSION >= 0x030000
 # ifdef __ASSUME_SOCKETCALL
 #  define __ASSUME_SENDMMSG_SOCKETCALL	1

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]