unofficial mirror of libc-alpha@sourceware.org
 help / color / mirror / Atom feed
* [PATCH v2 0/5] Remove Linux generic sysdep
@ 2022-12-07 21:22 Adhemerval Zanella via Libc-alpha
  2022-12-07 21:22 ` [PATCH v2 1/5] Linux: Move wordsize-32 Version to default Adhemerval Zanella via Libc-alpha
                   ` (5 more replies)
  0 siblings, 6 replies; 11+ messages in thread
From: Adhemerval Zanella via Libc-alpha @ 2022-12-07 21:22 UTC (permalink / raw)
  To: libc-alpha, Carlos O'Donell

With recent BZ#29657, where struct stat were not adapted for 64 time
because I forgot that generic folder is not always used for ports with
default 64 bit time_t; it seems better to finish the generic
integration and make the Linux default implementation the de-facto
"generic" implementation.

Changes for v2:
- Fixed sparc32 getsockname and getpeername kernel definition.
- Added epoll_create and inotify_init Makefile rules.
- Expanded commits messages.

Adhemerval Zanella (5):
  Linux: Move wordsize-32 Version to default
  Linux: Assume and consolidate getsockname wire-up syscall
  Linux: Assume and consolidate getpeername wire-up syscall
  Linux: Remove unused generic Makefile
  Linux: Remove generic Implies

 sysdeps/unix/sysv/linux/Makefile                     |  2 ++
 sysdeps/unix/sysv/linux/Versions                     |  3 +++
 sysdeps/unix/sysv/linux/aarch64/Implies              |  1 -
 sysdeps/unix/sysv/linux/arc/Implies                  |  2 --
 sysdeps/unix/sysv/linux/arm/Versions                 |  3 ---
 sysdeps/unix/sysv/linux/csky/Implies                 |  2 --
 sysdeps/unix/sysv/linux/generic/Makefile             |  3 ---
 sysdeps/unix/sysv/linux/generic/README               | 11 -----------
 sysdeps/unix/sysv/linux/generic/syscalls.list        |  5 -----
 sysdeps/unix/sysv/linux/generic/wordsize-32/Versions |  5 -----
 sysdeps/unix/sysv/linux/getpeername.c                |  7 +------
 sysdeps/unix/sysv/linux/getsockname.c                |  7 +------
 sysdeps/unix/sysv/linux/hppa/Versions                |  3 ---
 sysdeps/unix/sysv/linux/i386/Versions                |  4 ----
 sysdeps/unix/sysv/linux/i386/kernel-features.h       |  8 ++------
 sysdeps/unix/sysv/linux/kernel-features.h            |  2 ++
 sysdeps/unix/sysv/linux/loongarch/lp64/Implies       |  1 -
 sysdeps/unix/sysv/linux/m68k/Versions                |  3 ---
 sysdeps/unix/sysv/linux/m68k/kernel-features.h       |  8 ++------
 sysdeps/unix/sysv/linux/microblaze/Versions          |  5 -----
 sysdeps/unix/sysv/linux/microblaze/kernel-features.h |  2 --
 sysdeps/unix/sysv/linux/mips/Versions                |  3 ---
 sysdeps/unix/sysv/linux/nios2/Implies                |  2 --
 sysdeps/unix/sysv/linux/or1k/Implies                 |  2 --
 sysdeps/unix/sysv/linux/powerpc/kernel-features.h    |  2 --
 sysdeps/unix/sysv/linux/powerpc/powerpc32/Versions   |  3 ---
 sysdeps/unix/sysv/linux/riscv/rv32/Implies           |  2 --
 sysdeps/unix/sysv/linux/riscv/rv64/Implies           |  1 -
 sysdeps/unix/sysv/linux/s390/kernel-features.h       |  8 ++------
 sysdeps/unix/sysv/linux/s390/s390-32/Versions        |  3 ---
 sysdeps/unix/sysv/linux/sh/Versions                  |  3 ---
 sysdeps/unix/sysv/linux/sh/kernel-features.h         |  2 --
 sysdeps/unix/sysv/linux/sparc/kernel-features.h      |  7 +++++++
 sysdeps/unix/sysv/linux/sparc/sparc32/Versions       |  3 ---
 sysdeps/unix/sysv/linux/syscalls.list                |  2 --
 35 files changed, 22 insertions(+), 108 deletions(-)
 delete mode 100644 sysdeps/unix/sysv/linux/generic/Makefile
 delete mode 100644 sysdeps/unix/sysv/linux/generic/README
 delete mode 100644 sysdeps/unix/sysv/linux/generic/syscalls.list
 delete mode 100644 sysdeps/unix/sysv/linux/generic/wordsize-32/Versions
 delete mode 100644 sysdeps/unix/sysv/linux/microblaze/Versions

-- 
2.34.1


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

* [PATCH v2 1/5] Linux: Move wordsize-32 Version to default
  2022-12-07 21:22 [PATCH v2 0/5] Remove Linux generic sysdep Adhemerval Zanella via Libc-alpha
@ 2022-12-07 21:22 ` Adhemerval Zanella via Libc-alpha
  2023-02-19 21:11   ` Carlos O'Donell via Libc-alpha
  2022-12-07 21:22 ` [PATCH v2 2/5] Linux: Assume and consolidate getsockname wire-up syscall Adhemerval Zanella via Libc-alpha
                   ` (4 subsequent siblings)
  5 siblings, 1 reply; 11+ messages in thread
From: Adhemerval Zanella via Libc-alpha @ 2022-12-07 21:22 UTC (permalink / raw)
  To: libc-alpha, Carlos O'Donell

And remove redundant entries on other architectures Version.  The
version for fallocate64 was supposed to be 2.10, but itt was then
added to 32-bit platforms in 2.11 because it mistakenly wasn't
exported for them in  2.10 (see the commit message for
1f3615a1c97a030bca59f728f998947f852679b9).  linux/generic did not
exist before 2.15, i.e. when the tile ports were added (and
microblaze did not exist before 2.18), which explains those
differences but also illustrates that "2.11 for 32-bit, 2.10 for
 64-bit" should be sufficient since versions older than the minimum
for the architecture are automatically adjusted.
---
 sysdeps/unix/sysv/linux/Versions                     | 3 +++
 sysdeps/unix/sysv/linux/arm/Versions                 | 3 ---
 sysdeps/unix/sysv/linux/generic/wordsize-32/Versions | 5 -----
 sysdeps/unix/sysv/linux/hppa/Versions                | 3 ---
 sysdeps/unix/sysv/linux/i386/Versions                | 4 ----
 sysdeps/unix/sysv/linux/m68k/Versions                | 3 ---
 sysdeps/unix/sysv/linux/microblaze/Versions          | 5 -----
 sysdeps/unix/sysv/linux/mips/Versions                | 3 ---
 sysdeps/unix/sysv/linux/powerpc/powerpc32/Versions   | 3 ---
 sysdeps/unix/sysv/linux/s390/s390-32/Versions        | 3 ---
 sysdeps/unix/sysv/linux/sh/Versions                  | 3 ---
 sysdeps/unix/sysv/linux/sparc/sparc32/Versions       | 3 ---
 12 files changed, 3 insertions(+), 38 deletions(-)
 delete mode 100644 sysdeps/unix/sysv/linux/generic/wordsize-32/Versions
 delete mode 100644 sysdeps/unix/sysv/linux/microblaze/Versions

diff --git a/sysdeps/unix/sysv/linux/Versions b/sysdeps/unix/sysv/linux/Versions
index ca6eb1a49e..bc59bce42f 100644
--- a/sysdeps/unix/sysv/linux/Versions
+++ b/sysdeps/unix/sysv/linux/Versions
@@ -157,6 +157,9 @@ libc {
   GLIBC_2.10 {
     fallocate;
   }
+  GLIBC_2.11 {
+    fallocate64;
+  }
   GLIBC_2.12 {
     _sys_errlist; sys_errlist; _sys_nerr; sys_nerr;
 
diff --git a/sysdeps/unix/sysv/linux/arm/Versions b/sysdeps/unix/sysv/linux/arm/Versions
index 7e5ba53455..6e7cb6e2e5 100644
--- a/sysdeps/unix/sysv/linux/arm/Versions
+++ b/sysdeps/unix/sysv/linux/arm/Versions
@@ -4,9 +4,6 @@ libc {
     inb; inw; inl;
     outb; outw; outl;
   }
-  GLIBC_2.11 {
-    fallocate64;
-  }
   GLIBC_2.24 {
     recvmsg; sendmsg;
   }
diff --git a/sysdeps/unix/sysv/linux/generic/wordsize-32/Versions b/sysdeps/unix/sysv/linux/generic/wordsize-32/Versions
deleted file mode 100644
index cdc6022015..0000000000
--- a/sysdeps/unix/sysv/linux/generic/wordsize-32/Versions
+++ /dev/null
@@ -1,5 +0,0 @@
-libc {
-  GLIBC_2.15 {
-    fallocate64;
-  }
-}
diff --git a/sysdeps/unix/sysv/linux/hppa/Versions b/sysdeps/unix/sysv/linux/hppa/Versions
index 357c68a782..78528e5fa2 100644
--- a/sysdeps/unix/sysv/linux/hppa/Versions
+++ b/sysdeps/unix/sysv/linux/hppa/Versions
@@ -13,9 +13,6 @@ libc {
   GLIBC_2.4 {
     _sys_errlist; sys_errlist; _sys_nerr; sys_nerr;
   }
-  GLIBC_2.11 {
-    fallocate64;
-  }
   GLIBC_2.12 {
     _sys_errlist; sys_errlist; _sys_nerr; sys_nerr;
   }
diff --git a/sysdeps/unix/sysv/linux/i386/Versions b/sysdeps/unix/sysv/linux/i386/Versions
index 1335e6551b..f99a4d88d0 100644
--- a/sysdeps/unix/sysv/linux/i386/Versions
+++ b/sysdeps/unix/sysv/linux/i386/Versions
@@ -37,10 +37,6 @@ libc {
     # v*
     vm86;
   }
-  GLIBC_2.11 {
-    # f*
-    fallocate64;
-  }
   GLIBC_PRIVATE {
     __modify_ldt; __uname;
   }
diff --git a/sysdeps/unix/sysv/linux/m68k/Versions b/sysdeps/unix/sysv/linux/m68k/Versions
index d98ae120c1..a77ea60338 100644
--- a/sysdeps/unix/sysv/linux/m68k/Versions
+++ b/sysdeps/unix/sysv/linux/m68k/Versions
@@ -29,9 +29,6 @@ libc {
     # v*
     versionsort64;
   }
-  GLIBC_2.11 {
-    fallocate64;
-  }
   GLIBC_2.31 {
     msgctl; semctl; shmctl;
   }
diff --git a/sysdeps/unix/sysv/linux/microblaze/Versions b/sysdeps/unix/sysv/linux/microblaze/Versions
deleted file mode 100644
index aa48a3c155..0000000000
--- a/sysdeps/unix/sysv/linux/microblaze/Versions
+++ /dev/null
@@ -1,5 +0,0 @@
-libc {
-  GLIBC_2.18 {
-    fallocate64;
-  }
-}
diff --git a/sysdeps/unix/sysv/linux/mips/Versions b/sysdeps/unix/sysv/linux/mips/Versions
index db6222e9a7..9ea0fa65a4 100644
--- a/sysdeps/unix/sysv/linux/mips/Versions
+++ b/sysdeps/unix/sysv/linux/mips/Versions
@@ -26,9 +26,6 @@ libc {
     pthread_attr_setstack;
     pthread_attr_setstacksize;
   }
-  GLIBC_2.11 {
-    fallocate64;
-  }
   GLIBC_PRIVATE {
     # nptl/pthread_cond_timedwait.c uses INTERNAL_VSYSCALL(clock_gettime).
     __vdso_clock_gettime;
diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc32/Versions b/sysdeps/unix/sysv/linux/powerpc/powerpc32/Versions
index 918e0231d0..416e8db5ae 100644
--- a/sysdeps/unix/sysv/linux/powerpc/powerpc32/Versions
+++ b/sysdeps/unix/sysv/linux/powerpc/powerpc32/Versions
@@ -31,9 +31,6 @@ libc {
     siglongjmp;
     swapcontext;
   }
-  GLIBC_2.11 {
-    fallocate64;
-  }
   GLIBC_2.17 {
     __ppc_get_timebase_freq;
   }
diff --git a/sysdeps/unix/sysv/linux/s390/s390-32/Versions b/sysdeps/unix/sysv/linux/s390/s390-32/Versions
index bd1a46df88..1b96fc42a3 100644
--- a/sysdeps/unix/sysv/linux/s390/s390-32/Versions
+++ b/sysdeps/unix/sysv/linux/s390/s390-32/Versions
@@ -44,9 +44,6 @@ libc {
     getutmpx;
     login;
   }
-  GLIBC_2.11 {
-    fallocate64;
-  }
   GLIBC_2.31 {
     msgctl; semctl; shmctl;
   }
diff --git a/sysdeps/unix/sysv/linux/sh/Versions b/sysdeps/unix/sysv/linux/sh/Versions
index 9c734ff755..3ad702e165 100644
--- a/sysdeps/unix/sysv/linux/sh/Versions
+++ b/sysdeps/unix/sysv/linux/sh/Versions
@@ -22,9 +22,6 @@ libc {
     # v*
     versionsort64;
   }
-  GLIBC_2.11 {
-    fallocate64;
-  }
   GLIBC_2.16 {
     fanotify_mark;
   }
diff --git a/sysdeps/unix/sysv/linux/sparc/sparc32/Versions b/sysdeps/unix/sysv/linux/sparc/sparc32/Versions
index d928a65346..4529e7fe6f 100644
--- a/sysdeps/unix/sysv/linux/sparc/sparc32/Versions
+++ b/sysdeps/unix/sysv/linux/sparc/sparc32/Versions
@@ -17,7 +17,4 @@ libc {
     # s*
     scandir64;
   }
-  GLIBC_2.11 {
-    fallocate64;
-  }
 }
-- 
2.34.1


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

* [PATCH v2 2/5] Linux: Assume and consolidate getsockname wire-up syscall
  2022-12-07 21:22 [PATCH v2 0/5] Remove Linux generic sysdep Adhemerval Zanella via Libc-alpha
  2022-12-07 21:22 ` [PATCH v2 1/5] Linux: Move wordsize-32 Version to default Adhemerval Zanella via Libc-alpha
@ 2022-12-07 21:22 ` Adhemerval Zanella via Libc-alpha
  2023-02-19 21:20   ` Carlos O'Donell via Libc-alpha
  2022-12-07 21:22 ` [PATCH v2 3/5] Linux: Assume and consolidate getpeername " Adhemerval Zanella via Libc-alpha
                   ` (3 subsequent siblings)
  5 siblings, 1 reply; 11+ messages in thread
From: Adhemerval Zanella via Libc-alpha @ 2022-12-07 21:22 UTC (permalink / raw)
  To: libc-alpha, Carlos O'Donell

And disable if kernel does not support it.

Checked on x86_64-linux-gnu and i686-linux-gnu.
---
 sysdeps/unix/sysv/linux/generic/syscalls.list        | 1 -
 sysdeps/unix/sysv/linux/getsockname.c                | 7 +------
 sysdeps/unix/sysv/linux/i386/kernel-features.h       | 2 +-
 sysdeps/unix/sysv/linux/kernel-features.h            | 1 +
 sysdeps/unix/sysv/linux/m68k/kernel-features.h       | 2 +-
 sysdeps/unix/sysv/linux/microblaze/kernel-features.h | 1 -
 sysdeps/unix/sysv/linux/powerpc/kernel-features.h    | 1 -
 sysdeps/unix/sysv/linux/s390/kernel-features.h       | 2 +-
 sysdeps/unix/sysv/linux/sh/kernel-features.h         | 1 -
 sysdeps/unix/sysv/linux/sparc/kernel-features.h      | 6 ++++++
 10 files changed, 11 insertions(+), 13 deletions(-)

diff --git a/sysdeps/unix/sysv/linux/generic/syscalls.list b/sysdeps/unix/sysv/linux/generic/syscalls.list
index 7dbfde0dae..e89ce91ac0 100644
--- a/sysdeps/unix/sysv/linux/generic/syscalls.list
+++ b/sysdeps/unix/sysv/linux/generic/syscalls.list
@@ -1,5 +1,4 @@
 # File name	Caller	Syscall name	# args	Strong name	Weak names
 
 # Socket APIs
-getsockname	-	getsockname	i:ipp	__getsockname	getsockname
 getpeername	-	getpeername	i:ipp	__getpeername	getpeername
diff --git a/sysdeps/unix/sysv/linux/getsockname.c b/sysdeps/unix/sysv/linux/getsockname.c
index d0718c2aaf..8350b800fe 100644
--- a/sysdeps/unix/sysv/linux/getsockname.c
+++ b/sysdeps/unix/sysv/linux/getsockname.c
@@ -15,19 +15,14 @@
    License along with the GNU C Library; if not, see
    <https://www.gnu.org/licenses/>.  */
 
-#include <errno.h>
-#include <signal.h>
 #include <sys/socket.h>
-
 #include <socketcall.h>
-#include <kernel-features.h>
-#include <sys/syscall.h>
 
 int
 __getsockname (int fd, __SOCKADDR_ARG addr, socklen_t *len)
 {
 #ifdef __ASSUME_GETSOCKNAME_SYSCALL
-  return INLINE_SYSCALL (getsockname, 3, fd, addr.__sockaddr__, len);
+  return INLINE_SYSCALL_CALL (getsockname, fd, addr.__sockaddr__, len);
 #else
   return SOCKETCALL (getsockname, fd, addr.__sockaddr__, len);
 #endif
diff --git a/sysdeps/unix/sysv/linux/i386/kernel-features.h b/sysdeps/unix/sysv/linux/i386/kernel-features.h
index ddf9ec0e5f..0c949349e1 100644
--- a/sysdeps/unix/sysv/linux/i386/kernel-features.h
+++ b/sysdeps/unix/sysv/linux/i386/kernel-features.h
@@ -19,7 +19,6 @@
 
 /* Direct socketcalls available with kernel 4.3.  */
 #if __LINUX_KERNEL_VERSION >= 0x040300
-# define __ASSUME_GETSOCKNAME_SYSCALL        1
 # define __ASSUME_GETPEERNAME_SYSCALL        1
 #endif
 
@@ -42,6 +41,7 @@
 # undef __ASSUME_SOCKETPAIR_SYSCALL
 # undef __ASSUME_LISTEN_SYSCALL
 # undef __ASSUME_SHUTDOWN_SYSCALL
+# undef __ASSUME_GETSOCKNAME_SYSCALL
 #endif
 
 /* i686 only supports ipc syscall before 5.1.  */
diff --git a/sysdeps/unix/sysv/linux/kernel-features.h b/sysdeps/unix/sysv/linux/kernel-features.h
index e63bd4b4fc..cac8708050 100644
--- a/sysdeps/unix/sysv/linux/kernel-features.h
+++ b/sysdeps/unix/sysv/linux/kernel-features.h
@@ -84,6 +84,7 @@
 #define __ASSUME_SOCKETPAIR_SYSCALL	1
 #define __ASSUME_LISTEN_SYSCALL		1
 #define __ASSUME_SHUTDOWN_SYSCALL	1
+#define __ASSUME_GETSOCKNAME_SYSCALL	1
 
 /* Support for SysV IPC through wired syscalls.  All supported architectures
    either support ipc syscall and/or all the ipc correspondent syscalls.  */
diff --git a/sysdeps/unix/sysv/linux/m68k/kernel-features.h b/sysdeps/unix/sysv/linux/m68k/kernel-features.h
index 55b8958fb2..b8f8e48c8a 100644
--- a/sysdeps/unix/sysv/linux/m68k/kernel-features.h
+++ b/sysdeps/unix/sysv/linux/m68k/kernel-features.h
@@ -19,7 +19,6 @@
 
 /* Direct socketcalls available with kernel 4.3.  */
 #if __LINUX_KERNEL_VERSION >= 0x040300
-# define __ASSUME_GETSOCKNAME_SYSCALL        1
 # define __ASSUME_GETPEERNAME_SYSCALL        1
 #endif
 
@@ -44,6 +43,7 @@
 # undef __ASSUME_SOCKETPAIR_SYSCALL
 # undef __ASSUME_LISTEN_SYSCALL
 # undef __ASSUME_SHUTDOWN_SYSCALL
+# undef __ASSUME_GETSOCKNAME_SYSCALL
 #endif
 
 /* No support for PI futexes or robust mutexes before 3.10 for m68k.  */
diff --git a/sysdeps/unix/sysv/linux/microblaze/kernel-features.h b/sysdeps/unix/sysv/linux/microblaze/kernel-features.h
index 9ee6c621ee..12f9a55b03 100644
--- a/sysdeps/unix/sysv/linux/microblaze/kernel-features.h
+++ b/sysdeps/unix/sysv/linux/microblaze/kernel-features.h
@@ -19,7 +19,6 @@
 
 /* All supported kernel versions for MicroBlaze have these syscalls.  */
 #define __ASSUME_CONNECT_SYSCALL	1
-#define __ASSUME_GETSOCKNAME_SYSCALL	1
 #define __ASSUME_GETPEERNAME_SYSCALL	1
 #define __ASSUME_SEND_SYSCALL		1
 #define __ASSUME_RECV_SYSCALL		1
diff --git a/sysdeps/unix/sysv/linux/powerpc/kernel-features.h b/sysdeps/unix/sysv/linux/powerpc/kernel-features.h
index ad9eb340b5..852bac0313 100644
--- a/sysdeps/unix/sysv/linux/powerpc/kernel-features.h
+++ b/sysdeps/unix/sysv/linux/powerpc/kernel-features.h
@@ -19,7 +19,6 @@
 
 /* New syscalls added for PowerPC in 2.6.37.  */
 #define __ASSUME_CONNECT_SYSCALL	1
-#define __ASSUME_GETSOCKNAME_SYSCALL	1
 #define __ASSUME_GETPEERNAME_SYSCALL	1
 #define __ASSUME_SEND_SYSCALL		1
 #define __ASSUME_RECV_SYSCALL		1
diff --git a/sysdeps/unix/sysv/linux/s390/kernel-features.h b/sysdeps/unix/sysv/linux/s390/kernel-features.h
index e47c628f51..3a3942fa68 100644
--- a/sysdeps/unix/sysv/linux/s390/kernel-features.h
+++ b/sysdeps/unix/sysv/linux/s390/kernel-features.h
@@ -19,7 +19,6 @@
 
 /* Direct socketcalls available with kernel 4.3.  */
 #if __LINUX_KERNEL_VERSION >= 0x040300
-# define __ASSUME_GETSOCKNAME_SYSCALL        1
 # define __ASSUME_GETPEERNAME_SYSCALL        1
 #endif
 
@@ -44,6 +43,7 @@
 # undef __ASSUME_SOCKETPAIR_SYSCALL
 # undef __ASSUME_LISTEN_SYSCALL
 # undef __ASSUME_SHUTDOWN_SYSCALL
+# undef __ASSUME_GETSOCKNAME_SYSCALL
 #endif
 
 /* s390 only supports ipc syscall before 5.1.  */
diff --git a/sysdeps/unix/sysv/linux/sh/kernel-features.h b/sysdeps/unix/sysv/linux/sh/kernel-features.h
index 0ab656d58e..7a15569dfc 100644
--- a/sysdeps/unix/sysv/linux/sh/kernel-features.h
+++ b/sysdeps/unix/sysv/linux/sh/kernel-features.h
@@ -24,7 +24,6 @@
 
 /* These syscalls were added for SH in 2.6.37.  */
 #define __ASSUME_CONNECT_SYSCALL	1
-#define __ASSUME_GETSOCKNAME_SYSCALL	1
 #define __ASSUME_GETPEERNAME_SYSCALL	1
 #define __ASSUME_SEND_SYSCALL		1
 #define __ASSUME_RECV_SYSCALL		1
diff --git a/sysdeps/unix/sysv/linux/sparc/kernel-features.h b/sysdeps/unix/sysv/linux/sparc/kernel-features.h
index 12e98a9f95..8ada43587b 100644
--- a/sysdeps/unix/sysv/linux/sparc/kernel-features.h
+++ b/sysdeps/unix/sysv/linux/sparc/kernel-features.h
@@ -42,6 +42,12 @@
 # undef __ASSUME_SETSOCKOPT_SYSCALL
 #endif
 
+/* There syscalls were added for 32-bit in compat syscall table only
+   in 4.20 (but present for 64-bit in all supported kernel versions).  */
+#if !defined __arch64__ && __LINUX_KERNEL_VERSION < 0x041400
+# undef __ASSUME_GETSOCKNAME_SYSCALL
+#endif
+
 /* These syscalls were added for both 32-bit and 64-bit in 4.4.  */
 #if __LINUX_KERNEL_VERSION < 0x040400
 # undef __ASSUME_BIND_SYSCALL
-- 
2.34.1


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

* [PATCH v2 3/5] Linux: Assume and consolidate getpeername wire-up syscall
  2022-12-07 21:22 [PATCH v2 0/5] Remove Linux generic sysdep Adhemerval Zanella via Libc-alpha
  2022-12-07 21:22 ` [PATCH v2 1/5] Linux: Move wordsize-32 Version to default Adhemerval Zanella via Libc-alpha
  2022-12-07 21:22 ` [PATCH v2 2/5] Linux: Assume and consolidate getsockname wire-up syscall Adhemerval Zanella via Libc-alpha
@ 2022-12-07 21:22 ` Adhemerval Zanella via Libc-alpha
  2023-02-19 21:23   ` Carlos O'Donell via Libc-alpha
  2022-12-07 21:22 ` [PATCH v2 4/5] Linux: Remove unused generic Makefile Adhemerval Zanella via Libc-alpha
                   ` (2 subsequent siblings)
  5 siblings, 1 reply; 11+ messages in thread
From: Adhemerval Zanella via Libc-alpha @ 2022-12-07 21:22 UTC (permalink / raw)
  To: libc-alpha, Carlos O'Donell

And disable if kernel does not support it.

Checked on x86_64-linux-gnu and i686-linux-gnu.
---
 sysdeps/unix/sysv/linux/generic/syscalls.list        | 4 ----
 sysdeps/unix/sysv/linux/getpeername.c                | 7 +------
 sysdeps/unix/sysv/linux/i386/kernel-features.h       | 6 +-----
 sysdeps/unix/sysv/linux/kernel-features.h            | 1 +
 sysdeps/unix/sysv/linux/m68k/kernel-features.h       | 6 +-----
 sysdeps/unix/sysv/linux/microblaze/kernel-features.h | 1 -
 sysdeps/unix/sysv/linux/powerpc/kernel-features.h    | 1 -
 sysdeps/unix/sysv/linux/s390/kernel-features.h       | 6 +-----
 sysdeps/unix/sysv/linux/sh/kernel-features.h         | 1 -
 sysdeps/unix/sysv/linux/sparc/kernel-features.h      | 1 +
 10 files changed, 6 insertions(+), 28 deletions(-)
 delete mode 100644 sysdeps/unix/sysv/linux/generic/syscalls.list

diff --git a/sysdeps/unix/sysv/linux/generic/syscalls.list b/sysdeps/unix/sysv/linux/generic/syscalls.list
deleted file mode 100644
index e89ce91ac0..0000000000
--- a/sysdeps/unix/sysv/linux/generic/syscalls.list
+++ /dev/null
@@ -1,4 +0,0 @@
-# File name	Caller	Syscall name	# args	Strong name	Weak names
-
-# Socket APIs
-getpeername	-	getpeername	i:ipp	__getpeername	getpeername
diff --git a/sysdeps/unix/sysv/linux/getpeername.c b/sysdeps/unix/sysv/linux/getpeername.c
index 09ca76b9ad..63fa8e2fe5 100644
--- a/sysdeps/unix/sysv/linux/getpeername.c
+++ b/sysdeps/unix/sysv/linux/getpeername.c
@@ -15,19 +15,14 @@
    License along with the GNU C Library; if not, see
    <https://www.gnu.org/licenses/>.  */
 
-#include <errno.h>
-#include <signal.h>
 #include <sys/socket.h>
-
 #include <socketcall.h>
-#include <kernel-features.h>
-#include <sys/syscall.h>
 
 int
 __getpeername (int fd, __SOCKADDR_ARG addr, socklen_t *len)
 {
 #ifdef __ASSUME_GETPEERNAME_SYSCALL
-  return INLINE_SYSCALL (getpeername, 3, fd, addr.__sockaddr__, len);
+  return INLINE_SYSCALL_CALL (getpeername, fd, addr.__sockaddr__, len);
 #else
   return SOCKETCALL (getpeername, fd, addr.__sockaddr__, len);
 #endif
diff --git a/sysdeps/unix/sysv/linux/i386/kernel-features.h b/sysdeps/unix/sysv/linux/i386/kernel-features.h
index 0c949349e1..d3d5376b92 100644
--- a/sysdeps/unix/sysv/linux/i386/kernel-features.h
+++ b/sysdeps/unix/sysv/linux/i386/kernel-features.h
@@ -17,11 +17,6 @@
    License along with the GNU C Library; if not, see
    <https://www.gnu.org/licenses/>.  */
 
-/* Direct socketcalls available with kernel 4.3.  */
-#if __LINUX_KERNEL_VERSION >= 0x040300
-# define __ASSUME_GETPEERNAME_SYSCALL        1
-#endif
-
 #include_next <kernel-features.h>
 
 #undef __ASSUME_ACCEPT_SYSCALL
@@ -42,6 +37,7 @@
 # undef __ASSUME_LISTEN_SYSCALL
 # undef __ASSUME_SHUTDOWN_SYSCALL
 # undef __ASSUME_GETSOCKNAME_SYSCALL
+# undef __ASSUME_GETPEERNAME_SYSCALL
 #endif
 
 /* i686 only supports ipc syscall before 5.1.  */
diff --git a/sysdeps/unix/sysv/linux/kernel-features.h b/sysdeps/unix/sysv/linux/kernel-features.h
index cac8708050..403223c565 100644
--- a/sysdeps/unix/sysv/linux/kernel-features.h
+++ b/sysdeps/unix/sysv/linux/kernel-features.h
@@ -85,6 +85,7 @@
 #define __ASSUME_LISTEN_SYSCALL		1
 #define __ASSUME_SHUTDOWN_SYSCALL	1
 #define __ASSUME_GETSOCKNAME_SYSCALL	1
+#define __ASSUME_GETPEERNAME_SYSCALL	1
 
 /* Support for SysV IPC through wired syscalls.  All supported architectures
    either support ipc syscall and/or all the ipc correspondent syscalls.  */
diff --git a/sysdeps/unix/sysv/linux/m68k/kernel-features.h b/sysdeps/unix/sysv/linux/m68k/kernel-features.h
index b8f8e48c8a..6f7f4b2481 100644
--- a/sysdeps/unix/sysv/linux/m68k/kernel-features.h
+++ b/sysdeps/unix/sysv/linux/m68k/kernel-features.h
@@ -17,11 +17,6 @@
    License along with the GNU C Library.  If not, see
    <https://www.gnu.org/licenses/>.  */
 
-/* Direct socketcalls available with kernel 4.3.  */
-#if __LINUX_KERNEL_VERSION >= 0x040300
-# define __ASSUME_GETPEERNAME_SYSCALL        1
-#endif
-
 #include_next <kernel-features.h>
 
 #undef __ASSUME_ACCEPT_SYSCALL
@@ -44,6 +39,7 @@
 # undef __ASSUME_LISTEN_SYSCALL
 # undef __ASSUME_SHUTDOWN_SYSCALL
 # undef __ASSUME_GETSOCKNAME_SYSCALL
+# undef __ASSUME_GETPEERNAME_SYSCALL
 #endif
 
 /* No support for PI futexes or robust mutexes before 3.10 for m68k.  */
diff --git a/sysdeps/unix/sysv/linux/microblaze/kernel-features.h b/sysdeps/unix/sysv/linux/microblaze/kernel-features.h
index 12f9a55b03..72496aa922 100644
--- a/sysdeps/unix/sysv/linux/microblaze/kernel-features.h
+++ b/sysdeps/unix/sysv/linux/microblaze/kernel-features.h
@@ -19,7 +19,6 @@
 
 /* All supported kernel versions for MicroBlaze have these syscalls.  */
 #define __ASSUME_CONNECT_SYSCALL	1
-#define __ASSUME_GETPEERNAME_SYSCALL	1
 #define __ASSUME_SEND_SYSCALL		1
 #define __ASSUME_RECV_SYSCALL		1
 
diff --git a/sysdeps/unix/sysv/linux/powerpc/kernel-features.h b/sysdeps/unix/sysv/linux/powerpc/kernel-features.h
index 852bac0313..e2dc7a15a3 100644
--- a/sysdeps/unix/sysv/linux/powerpc/kernel-features.h
+++ b/sysdeps/unix/sysv/linux/powerpc/kernel-features.h
@@ -19,7 +19,6 @@
 
 /* New syscalls added for PowerPC in 2.6.37.  */
 #define __ASSUME_CONNECT_SYSCALL	1
-#define __ASSUME_GETPEERNAME_SYSCALL	1
 #define __ASSUME_SEND_SYSCALL		1
 #define __ASSUME_RECV_SYSCALL		1
 
diff --git a/sysdeps/unix/sysv/linux/s390/kernel-features.h b/sysdeps/unix/sysv/linux/s390/kernel-features.h
index 3a3942fa68..254b3948f4 100644
--- a/sysdeps/unix/sysv/linux/s390/kernel-features.h
+++ b/sysdeps/unix/sysv/linux/s390/kernel-features.h
@@ -17,11 +17,6 @@
    License along with the GNU C Library; if not, see
    <https://www.gnu.org/licenses/>.  */
 
-/* Direct socketcalls available with kernel 4.3.  */
-#if __LINUX_KERNEL_VERSION >= 0x040300
-# define __ASSUME_GETPEERNAME_SYSCALL        1
-#endif
-
 #include_next <kernel-features.h>
 
 #undef __ASSUME_ACCEPT_SYSCALL
@@ -44,6 +39,7 @@
 # undef __ASSUME_LISTEN_SYSCALL
 # undef __ASSUME_SHUTDOWN_SYSCALL
 # undef __ASSUME_GETSOCKNAME_SYSCALL
+# undef __ASSUME_GETPEERNAME_SYSCALL
 #endif
 
 /* s390 only supports ipc syscall before 5.1.  */
diff --git a/sysdeps/unix/sysv/linux/sh/kernel-features.h b/sysdeps/unix/sysv/linux/sh/kernel-features.h
index 7a15569dfc..ae1387e7d7 100644
--- a/sysdeps/unix/sysv/linux/sh/kernel-features.h
+++ b/sysdeps/unix/sysv/linux/sh/kernel-features.h
@@ -24,7 +24,6 @@
 
 /* These syscalls were added for SH in 2.6.37.  */
 #define __ASSUME_CONNECT_SYSCALL	1
-#define __ASSUME_GETPEERNAME_SYSCALL	1
 #define __ASSUME_SEND_SYSCALL		1
 #define __ASSUME_RECV_SYSCALL		1
 
diff --git a/sysdeps/unix/sysv/linux/sparc/kernel-features.h b/sysdeps/unix/sysv/linux/sparc/kernel-features.h
index 8ada43587b..3ecaf36005 100644
--- a/sysdeps/unix/sysv/linux/sparc/kernel-features.h
+++ b/sysdeps/unix/sysv/linux/sparc/kernel-features.h
@@ -46,6 +46,7 @@
    in 4.20 (but present for 64-bit in all supported kernel versions).  */
 #if !defined __arch64__ && __LINUX_KERNEL_VERSION < 0x041400
 # undef __ASSUME_GETSOCKNAME_SYSCALL
+# undef __ASSUME_GETPEERNAME_SYSCALL
 #endif
 
 /* These syscalls were added for both 32-bit and 64-bit in 4.4.  */
-- 
2.34.1


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

* [PATCH v2 4/5] Linux: Remove unused generic Makefile
  2022-12-07 21:22 [PATCH v2 0/5] Remove Linux generic sysdep Adhemerval Zanella via Libc-alpha
                   ` (2 preceding siblings ...)
  2022-12-07 21:22 ` [PATCH v2 3/5] Linux: Assume and consolidate getpeername " Adhemerval Zanella via Libc-alpha
@ 2022-12-07 21:22 ` Adhemerval Zanella via Libc-alpha
  2023-02-19 21:27   ` Carlos O'Donell via Libc-alpha
  2022-12-08 12:46 ` [PATCH v2 5/5] Linux: Remove generic Implies Adhemerval Zanella via Libc-alpha
  2023-02-19 21:29 ` [PATCH v2 0/5] Remove Linux generic sysdep Carlos O'Donell via Libc-alpha
  5 siblings, 1 reply; 11+ messages in thread
From: Adhemerval Zanella via Libc-alpha @ 2022-12-07 21:22 UTC (permalink / raw)
  To: libc-alpha, Carlos O'Donell

Both are already defined on default linux Makefile.
---
 sysdeps/unix/sysv/linux/Makefile         | 2 ++
 sysdeps/unix/sysv/linux/generic/Makefile | 3 ---
 sysdeps/unix/sysv/linux/syscalls.list    | 2 --
 3 files changed, 2 insertions(+), 5 deletions(-)
 delete mode 100644 sysdeps/unix/sysv/linux/generic/Makefile

diff --git a/sysdeps/unix/sysv/linux/Makefile b/sysdeps/unix/sysv/linux/Makefile
index 60e4cb1521..632b49e9ec 100644
--- a/sysdeps/unix/sysv/linux/Makefile
+++ b/sysdeps/unix/sysv/linux/Makefile
@@ -69,6 +69,8 @@ sysdep_routines += adjtimex clone umount umount2 readahead sysctl \
 		   clone3 clone-internal \
 		   fanotify_mark \
 		   mremap \
+		   epoll_create \
+		   inotify_init
 
 CFLAGS-gethostid.c = -fexceptions
 CFLAGS-tee.c = -fexceptions -fasynchronous-unwind-tables
diff --git a/sysdeps/unix/sysv/linux/generic/Makefile b/sysdeps/unix/sysv/linux/generic/Makefile
deleted file mode 100644
index 7e27e79772..0000000000
--- a/sysdeps/unix/sysv/linux/generic/Makefile
+++ /dev/null
@@ -1,3 +0,0 @@
-ifeq ($(subdir),misc)
-sysdep_routines += epoll_create inotify_init
-endif
diff --git a/sysdeps/unix/sysv/linux/syscalls.list b/sysdeps/unix/sysv/linux/syscalls.list
index b9f45463c5..73e941ef89 100644
--- a/sysdeps/unix/sysv/linux/syscalls.list
+++ b/sysdeps/unix/sysv/linux/syscalls.list
@@ -6,7 +6,6 @@ capget		EXTRA	capget		i:pp	capget
 capset		EXTRA	capset		i:pp	capset
 create_module	EXTRA	create_module	3	__compat_create_module	create_module@GLIBC_2.0:GLIBC_2.23
 delete_module	EXTRA	delete_module	3	delete_module
-epoll_create	EXTRA	epoll_create	i:i	epoll_create
 epoll_create1	EXTRA	epoll_create1	i:i	epoll_create1
 epoll_ctl	EXTRA	epoll_ctl	i:iiip	epoll_ctl
 eventfd		EXTRA	eventfd2	i:ii	eventfd
@@ -28,7 +27,6 @@ getresgid	-	getresgid	i:ppp	getresgid
 getsid		-	getsid		i:i	getsid
 init_module	EXTRA	init_module	5	init_module
 inotify_add_watch	EXTRA	inotify_add_watch	i:isi	inotify_add_watch
-inotify_init	EXTRA	inotify_init	i:	inotify_init
 inotify_init1	EXTRA	inotify_init1	i:I	inotify_init1
 inotify_rm_watch	EXTRA	inotify_rm_watch	i:ii	inotify_rm_watch
 ioperm		-	ioperm		i:UUi	ioperm
-- 
2.34.1


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

* [PATCH v2 5/5] Linux: Remove generic Implies
  2022-12-07 21:22 [PATCH v2 0/5] Remove Linux generic sysdep Adhemerval Zanella via Libc-alpha
                   ` (3 preceding siblings ...)
  2022-12-07 21:22 ` [PATCH v2 4/5] Linux: Remove unused generic Makefile Adhemerval Zanella via Libc-alpha
@ 2022-12-08 12:46 ` Adhemerval Zanella via Libc-alpha
  2023-02-19 21:29 ` [PATCH v2 0/5] Remove Linux generic sysdep Carlos O'Donell via Libc-alpha
  5 siblings, 0 replies; 11+ messages in thread
From: Adhemerval Zanella via Libc-alpha @ 2022-12-08 12:46 UTC (permalink / raw)
  To: libc-alpha, Carlos O'Donell

The default Linux implementation already handled the Linux generic
ABIs interface used on newer architectures, so there is no need to
Imply the generic any longer.

Reviewed-by: Carlos O'Donell <carlos@redhat.com>
Tested-by: Carlos O'Donell <carlos@redhat.com>
---
 sysdeps/unix/sysv/linux/aarch64/Implies        |  1 -
 sysdeps/unix/sysv/linux/arc/Implies            |  2 --
 sysdeps/unix/sysv/linux/csky/Implies           |  2 --
 sysdeps/unix/sysv/linux/generic/README         | 11 -----------
 sysdeps/unix/sysv/linux/loongarch/lp64/Implies |  1 -
 sysdeps/unix/sysv/linux/nios2/Implies          |  2 --
 sysdeps/unix/sysv/linux/or1k/Implies           |  2 --
 sysdeps/unix/sysv/linux/riscv/rv32/Implies     |  2 --
 sysdeps/unix/sysv/linux/riscv/rv64/Implies     |  1 -
 9 files changed, 24 deletions(-)
 delete mode 100644 sysdeps/unix/sysv/linux/generic/README

diff --git a/sysdeps/unix/sysv/linux/aarch64/Implies b/sysdeps/unix/sysv/linux/aarch64/Implies
index 4409e19b92..9c2d2c9870 100644
--- a/sysdeps/unix/sysv/linux/aarch64/Implies
+++ b/sysdeps/unix/sysv/linux/aarch64/Implies
@@ -1,3 +1,2 @@
 aarch64/nptl
-unix/sysv/linux/generic
 unix/sysv/linux/wordsize-64
diff --git a/sysdeps/unix/sysv/linux/arc/Implies b/sysdeps/unix/sysv/linux/arc/Implies
index 7f739a0340..5c1698c045 100644
--- a/sysdeps/unix/sysv/linux/arc/Implies
+++ b/sysdeps/unix/sysv/linux/arc/Implies
@@ -1,3 +1 @@
 arc/nptl
-unix/sysv/linux/generic/wordsize-32
-unix/sysv/linux/generic
diff --git a/sysdeps/unix/sysv/linux/csky/Implies b/sysdeps/unix/sysv/linux/csky/Implies
index f37776ccef..2259772947 100644
--- a/sysdeps/unix/sysv/linux/csky/Implies
+++ b/sysdeps/unix/sysv/linux/csky/Implies
@@ -1,3 +1 @@
-unix/sysv/linux/generic/wordsize-32
-unix/sysv/linux/generic
 csky/nptl
diff --git a/sysdeps/unix/sysv/linux/generic/README b/sysdeps/unix/sysv/linux/generic/README
deleted file mode 100644
index 301a6107e1..0000000000
--- a/sysdeps/unix/sysv/linux/generic/README
+++ /dev/null
@@ -1,11 +0,0 @@
-This hierarchy supports Linux systems using the new
-asm-generic/unistd.h, which removes many familiar old syscalls.  For
-example, to implement open(), newer Linux architectures require glibc
-to invoke the __NR_openat syscall with AT_FDCWD.  This hierarchy
-provides all those implementations.
-
-It also provides support for 32-bit platforms using the 64-bit kernel
-syscall APIs, as the 32-bit ones are no longer provided.  Note that
-newer ILP32 environments (x32 or AArch64:ILP32, for example) are
-converting to use more 64-bit types in kernel syscalls, so that aspect
-of this support is in more flux as of this writing.
diff --git a/sysdeps/unix/sysv/linux/loongarch/lp64/Implies b/sysdeps/unix/sysv/linux/loongarch/lp64/Implies
index 117c2b8efe..e0390cc3bf 100644
--- a/sysdeps/unix/sysv/linux/loongarch/lp64/Implies
+++ b/sysdeps/unix/sysv/linux/loongarch/lp64/Implies
@@ -1,3 +1,2 @@
 unix/sysv/linux/loongarch
-unix/sysv/linux/generic
 unix/sysv/linux/wordsize-64
diff --git a/sysdeps/unix/sysv/linux/nios2/Implies b/sysdeps/unix/sysv/linux/nios2/Implies
index 4d0478bf8f..e6c9be4665 100644
--- a/sysdeps/unix/sysv/linux/nios2/Implies
+++ b/sysdeps/unix/sysv/linux/nios2/Implies
@@ -1,3 +1 @@
 nios2/nptl
-unix/sysv/linux/generic/wordsize-32
-unix/sysv/linux/generic
diff --git a/sysdeps/unix/sysv/linux/or1k/Implies b/sysdeps/unix/sysv/linux/or1k/Implies
index f39f16c04a..07f8e71adc 100644
--- a/sysdeps/unix/sysv/linux/or1k/Implies
+++ b/sysdeps/unix/sysv/linux/or1k/Implies
@@ -1,3 +1 @@
 or1k/nptl
-unix/sysv/linux/generic/wordsize-32
-unix/sysv/linux/generic
diff --git a/sysdeps/unix/sysv/linux/riscv/rv32/Implies b/sysdeps/unix/sysv/linux/riscv/rv32/Implies
index 8b7deb33cd..83db34c5d5 100644
--- a/sysdeps/unix/sysv/linux/riscv/rv32/Implies
+++ b/sysdeps/unix/sysv/linux/riscv/rv32/Implies
@@ -1,3 +1 @@
 unix/sysv/linux/riscv
-unix/sysv/linux/generic/wordsize-32
-unix/sysv/linux/generic
diff --git a/sysdeps/unix/sysv/linux/riscv/rv64/Implies b/sysdeps/unix/sysv/linux/riscv/rv64/Implies
index f042343bf7..2f9ad9ff94 100644
--- a/sysdeps/unix/sysv/linux/riscv/rv64/Implies
+++ b/sysdeps/unix/sysv/linux/riscv/rv64/Implies
@@ -1,3 +1,2 @@
 unix/sysv/linux/riscv
-unix/sysv/linux/generic
 unix/sysv/linux/wordsize-64
-- 
2.34.1


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

* Re: [PATCH v2 1/5] Linux: Move wordsize-32 Version to default
  2022-12-07 21:22 ` [PATCH v2 1/5] Linux: Move wordsize-32 Version to default Adhemerval Zanella via Libc-alpha
@ 2023-02-19 21:11   ` Carlos O'Donell via Libc-alpha
  0 siblings, 0 replies; 11+ messages in thread
From: Carlos O'Donell via Libc-alpha @ 2023-02-19 21:11 UTC (permalink / raw)
  To: Adhemerval Zanella, libc-alpha

On 12/7/22 16:22, Adhemerval Zanella wrote:
> And remove redundant entries on other architectures Version.  The
> version for fallocate64 was supposed to be 2.10, but itt was then

s/itt/it/g

- Please fix the commit message.
- Post a v3 with my RB and TB lines added (and the other conflicts cleaned up)
- Then push to master.
- This should mean the bot cleans up patchwork and we should clean thses up as
  superseded.

> added to 32-bit platforms in 2.11 because it mistakenly wasn't
> exported for them in  2.10 (see the commit message for
> 1f3615a1c97a030bca59f728f998947f852679b9).  linux/generic did not
> exist before 2.15, i.e. when the tile ports were added (and

OK. Agreed.

> microblaze did not exist before 2.18), which explains those
> differences but also illustrates that "2.11 for 32-bit, 2.10 for

OK. I reviewed this and it looks corrct.

>  64-bit" should be sufficient since versions older than the minimum
> for the architecture are automatically adjusted.

LGTM.

Reviewed-by: Carlos O'Donell <carlos@redhat.com>
Tested-by: Carlos O'Donell <carlos@redhat.com>

> ---
>  sysdeps/unix/sysv/linux/Versions                     | 3 +++
>  sysdeps/unix/sysv/linux/arm/Versions                 | 3 ---
>  sysdeps/unix/sysv/linux/generic/wordsize-32/Versions | 5 -----
>  sysdeps/unix/sysv/linux/hppa/Versions                | 3 ---
>  sysdeps/unix/sysv/linux/i386/Versions                | 4 ----
>  sysdeps/unix/sysv/linux/m68k/Versions                | 3 ---
>  sysdeps/unix/sysv/linux/microblaze/Versions          | 5 -----
>  sysdeps/unix/sysv/linux/mips/Versions                | 3 ---
>  sysdeps/unix/sysv/linux/powerpc/powerpc32/Versions   | 3 ---
>  sysdeps/unix/sysv/linux/s390/s390-32/Versions        | 3 ---
>  sysdeps/unix/sysv/linux/sh/Versions                  | 3 ---
>  sysdeps/unix/sysv/linux/sparc/sparc32/Versions       | 3 ---
>  12 files changed, 3 insertions(+), 38 deletions(-)
>  delete mode 100644 sysdeps/unix/sysv/linux/generic/wordsize-32/Versions
>  delete mode 100644 sysdeps/unix/sysv/linux/microblaze/Versions
> 
> diff --git a/sysdeps/unix/sysv/linux/Versions b/sysdeps/unix/sysv/linux/Versions
> index ca6eb1a49e..bc59bce42f 100644
> --- a/sysdeps/unix/sysv/linux/Versions
> +++ b/sysdeps/unix/sysv/linux/Versions
> @@ -157,6 +157,9 @@ libc {
>    GLIBC_2.10 {
>      fallocate;
>    }
> +  GLIBC_2.11 {
> +    fallocate64;
> +  }

OK. Make this the default.

>    GLIBC_2.12 {
>      _sys_errlist; sys_errlist; _sys_nerr; sys_nerr;
>  
> diff --git a/sysdeps/unix/sysv/linux/arm/Versions b/sysdeps/unix/sysv/linux/arm/Versions
> index 7e5ba53455..6e7cb6e2e5 100644
> --- a/sysdeps/unix/sysv/linux/arm/Versions
> +++ b/sysdeps/unix/sysv/linux/arm/Versions
> @@ -4,9 +4,6 @@ libc {
>      inb; inw; inl;
>      outb; outw; outl;
>    }
> -  GLIBC_2.11 {
> -    fallocate64;
> -  }

OK. Matches default.

>    GLIBC_2.24 {
>      recvmsg; sendmsg;
>    }
> diff --git a/sysdeps/unix/sysv/linux/generic/wordsize-32/Versions b/sysdeps/unix/sysv/linux/generic/wordsize-32/Versions
> deleted file mode 100644
> index cdc6022015..0000000000
> --- a/sysdeps/unix/sysv/linux/generic/wordsize-32/Versions
> +++ /dev/null
> @@ -1,5 +0,0 @@
> -libc {
> -  GLIBC_2.15 {
> -    fallocate64;
> -  }
> -}

OK. This will get raised by ports which use it.

> diff --git a/sysdeps/unix/sysv/linux/hppa/Versions b/sysdeps/unix/sysv/linux/hppa/Versions
> index 357c68a782..78528e5fa2 100644
> --- a/sysdeps/unix/sysv/linux/hppa/Versions
> +++ b/sysdeps/unix/sysv/linux/hppa/Versions
> @@ -13,9 +13,6 @@ libc {
>    GLIBC_2.4 {
>      _sys_errlist; sys_errlist; _sys_nerr; sys_nerr;
>    }
> -  GLIBC_2.11 {
> -    fallocate64;
> -  }

OK. Matches default.

>    GLIBC_2.12 {
>      _sys_errlist; sys_errlist; _sys_nerr; sys_nerr;
>    }
> diff --git a/sysdeps/unix/sysv/linux/i386/Versions b/sysdeps/unix/sysv/linux/i386/Versions
> index 1335e6551b..f99a4d88d0 100644
> --- a/sysdeps/unix/sysv/linux/i386/Versions
> +++ b/sysdeps/unix/sysv/linux/i386/Versions
> @@ -37,10 +37,6 @@ libc {
>      # v*
>      vm86;
>    }
> -  GLIBC_2.11 {
> -    # f*
> -    fallocate64;
> -  }

OK. Matches default.

>    GLIBC_PRIVATE {
>      __modify_ldt; __uname;
>    }
> diff --git a/sysdeps/unix/sysv/linux/m68k/Versions b/sysdeps/unix/sysv/linux/m68k/Versions
> index d98ae120c1..a77ea60338 100644
> --- a/sysdeps/unix/sysv/linux/m68k/Versions
> +++ b/sysdeps/unix/sysv/linux/m68k/Versions
> @@ -29,9 +29,6 @@ libc {
>      # v*
>      versionsort64;
>    }
> -  GLIBC_2.11 {
> -    fallocate64;
> -  }

OK. Matches default.

>    GLIBC_2.31 {
>      msgctl; semctl; shmctl;
>    }
> diff --git a/sysdeps/unix/sysv/linux/microblaze/Versions b/sysdeps/unix/sysv/linux/microblaze/Versions
> deleted file mode 100644
> index aa48a3c155..0000000000
> --- a/sysdeps/unix/sysv/linux/microblaze/Versions
> +++ /dev/null
> @@ -1,5 +0,0 @@
> -libc {
> -  GLIBC_2.18 {
> -    fallocate64;
> -  }
> -}

OK. Microblaze is a 2.18 port, and shlib-versions is GLIBC_2.18 for the port.
OK. So fallocate64@@GLIBC_2.11 will be raised to fallocate64@@GLIBC_2.18 anyway.

> diff --git a/sysdeps/unix/sysv/linux/mips/Versions b/sysdeps/unix/sysv/linux/mips/Versions
> index db6222e9a7..9ea0fa65a4 100644
> --- a/sysdeps/unix/sysv/linux/mips/Versions
> +++ b/sysdeps/unix/sysv/linux/mips/Versions
> @@ -26,9 +26,6 @@ libc {
>      pthread_attr_setstack;
>      pthread_attr_setstacksize;
>    }
> -  GLIBC_2.11 {
> -    fallocate64;
> -  }

OK. Matches the default.

>    GLIBC_PRIVATE {
>      # nptl/pthread_cond_timedwait.c uses INTERNAL_VSYSCALL(clock_gettime).
>      __vdso_clock_gettime;
> diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc32/Versions b/sysdeps/unix/sysv/linux/powerpc/powerpc32/Versions
> index 918e0231d0..416e8db5ae 100644
> --- a/sysdeps/unix/sysv/linux/powerpc/powerpc32/Versions
> +++ b/sysdeps/unix/sysv/linux/powerpc/powerpc32/Versions
> @@ -31,9 +31,6 @@ libc {
>      siglongjmp;
>      swapcontext;
>    }
> -  GLIBC_2.11 {
> -    fallocate64;
> -  }

OK. Matches the default.

>    GLIBC_2.17 {
>      __ppc_get_timebase_freq;
>    }
> diff --git a/sysdeps/unix/sysv/linux/s390/s390-32/Versions b/sysdeps/unix/sysv/linux/s390/s390-32/Versions
> index bd1a46df88..1b96fc42a3 100644
> --- a/sysdeps/unix/sysv/linux/s390/s390-32/Versions
> +++ b/sysdeps/unix/sysv/linux/s390/s390-32/Versions
> @@ -44,9 +44,6 @@ libc {
>      getutmpx;
>      login;
>    }
> -  GLIBC_2.11 {
> -    fallocate64;
> -  }

OK. Matches the default.

>    GLIBC_2.31 {
>      msgctl; semctl; shmctl;
>    }
> diff --git a/sysdeps/unix/sysv/linux/sh/Versions b/sysdeps/unix/sysv/linux/sh/Versions
> index 9c734ff755..3ad702e165 100644
> --- a/sysdeps/unix/sysv/linux/sh/Versions
> +++ b/sysdeps/unix/sysv/linux/sh/Versions
> @@ -22,9 +22,6 @@ libc {
>      # v*
>      versionsort64;
>    }
> -  GLIBC_2.11 {
> -    fallocate64;
> -  }

OK. Matches the default.

>    GLIBC_2.16 {
>      fanotify_mark;
>    }
> diff --git a/sysdeps/unix/sysv/linux/sparc/sparc32/Versions b/sysdeps/unix/sysv/linux/sparc/sparc32/Versions
> index d928a65346..4529e7fe6f 100644
> --- a/sysdeps/unix/sysv/linux/sparc/sparc32/Versions
> +++ b/sysdeps/unix/sysv/linux/sparc/sparc32/Versions
> @@ -17,7 +17,4 @@ libc {
>      # s*
>      scandir64;
>    }
> -  GLIBC_2.11 {
> -    fallocate64;
> -  }

OK. Matches the default.

>  }

-- 
Cheers,
Carlos.


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

* Re: [PATCH v2 2/5] Linux: Assume and consolidate getsockname wire-up syscall
  2022-12-07 21:22 ` [PATCH v2 2/5] Linux: Assume and consolidate getsockname wire-up syscall Adhemerval Zanella via Libc-alpha
@ 2023-02-19 21:20   ` Carlos O'Donell via Libc-alpha
  0 siblings, 0 replies; 11+ messages in thread
From: Carlos O'Donell via Libc-alpha @ 2023-02-19 21:20 UTC (permalink / raw)
  To: Adhemerval Zanella, libc-alpha

On 12/7/22 16:22, Adhemerval Zanella wrote:
> And disable if kernel does not support it.
> 
> Checked on x86_64-linux-gnu and i686-linux-gnu.

LGTM.

Reviewed-by: Carlos O'Donell <carlos@redhat.com>
Tested-by: Carlos O'Donell <carlos@redhat.com>

> ---
>  sysdeps/unix/sysv/linux/generic/syscalls.list        | 1 -
>  sysdeps/unix/sysv/linux/getsockname.c                | 7 +------
>  sysdeps/unix/sysv/linux/i386/kernel-features.h       | 2 +-
>  sysdeps/unix/sysv/linux/kernel-features.h            | 1 +
>  sysdeps/unix/sysv/linux/m68k/kernel-features.h       | 2 +-
>  sysdeps/unix/sysv/linux/microblaze/kernel-features.h | 1 -
>  sysdeps/unix/sysv/linux/powerpc/kernel-features.h    | 1 -
>  sysdeps/unix/sysv/linux/s390/kernel-features.h       | 2 +-
>  sysdeps/unix/sysv/linux/sh/kernel-features.h         | 1 -
>  sysdeps/unix/sysv/linux/sparc/kernel-features.h      | 6 ++++++
>  10 files changed, 11 insertions(+), 13 deletions(-)
> 
> diff --git a/sysdeps/unix/sysv/linux/generic/syscalls.list b/sysdeps/unix/sysv/linux/generic/syscalls.list
> index 7dbfde0dae..e89ce91ac0 100644
> --- a/sysdeps/unix/sysv/linux/generic/syscalls.list
> +++ b/sysdeps/unix/sysv/linux/generic/syscalls.list
> @@ -1,5 +1,4 @@
>  # File name	Caller	Syscall name	# args	Strong name	Weak names
>  
>  # Socket APIs
> -getsockname	-	getsockname	i:ipp	__getsockname	getsockname

OK.

>  getpeername	-	getpeername	i:ipp	__getpeername	getpeername
> diff --git a/sysdeps/unix/sysv/linux/getsockname.c b/sysdeps/unix/sysv/linux/getsockname.c
> index d0718c2aaf..8350b800fe 100644
> --- a/sysdeps/unix/sysv/linux/getsockname.c
> +++ b/sysdeps/unix/sysv/linux/getsockname.c
> @@ -15,19 +15,14 @@
>     License along with the GNU C Library; if not, see
>     <https://www.gnu.org/licenses/>.  */
>  
> -#include <errno.h>
> -#include <signal.h>
>  #include <sys/socket.h>
> -
>  #include <socketcall.h>
> -#include <kernel-features.h>
> -#include <sys/syscall.h>
>  
>  int
>  __getsockname (int fd, __SOCKADDR_ARG addr, socklen_t *len)
>  {
>  #ifdef __ASSUME_GETSOCKNAME_SYSCALL
> -  return INLINE_SYSCALL (getsockname, 3, fd, addr.__sockaddr__, len);
> +  return INLINE_SYSCALL_CALL (getsockname, fd, addr.__sockaddr__, len);

OK.

>  #else
>    return SOCKETCALL (getsockname, fd, addr.__sockaddr__, len);
>  #endif
> diff --git a/sysdeps/unix/sysv/linux/i386/kernel-features.h b/sysdeps/unix/sysv/linux/i386/kernel-features.h
> index ddf9ec0e5f..0c949349e1 100644
> --- a/sysdeps/unix/sysv/linux/i386/kernel-features.h
> +++ b/sysdeps/unix/sysv/linux/i386/kernel-features.h
> @@ -19,7 +19,6 @@
>  
>  /* Direct socketcalls available with kernel 4.3.  */
>  #if __LINUX_KERNEL_VERSION >= 0x040300
> -# define __ASSUME_GETSOCKNAME_SYSCALL        1

OK. Refactoring here. We let the default linux generic decide what to do,
but if we are on < 4.3 then we disable trying getsockname. Semantics remain
the same, we just changed the way the default is set.

>  # define __ASSUME_GETPEERNAME_SYSCALL        1
>  #endif
>  
> @@ -42,6 +41,7 @@
>  # undef __ASSUME_SOCKETPAIR_SYSCALL
>  # undef __ASSUME_LISTEN_SYSCALL
>  # undef __ASSUME_SHUTDOWN_SYSCALL
> +# undef __ASSUME_GETSOCKNAME_SYSCALL

OK.

>  #endif
>  
>  /* i686 only supports ipc syscall before 5.1.  */
> diff --git a/sysdeps/unix/sysv/linux/kernel-features.h b/sysdeps/unix/sysv/linux/kernel-features.h
> index e63bd4b4fc..cac8708050 100644
> --- a/sysdeps/unix/sysv/linux/kernel-features.h
> +++ b/sysdeps/unix/sysv/linux/kernel-features.h
> @@ -84,6 +84,7 @@
>  #define __ASSUME_SOCKETPAIR_SYSCALL	1
>  #define __ASSUME_LISTEN_SYSCALL		1
>  #define __ASSUME_SHUTDOWN_SYSCALL	1
> +#define __ASSUME_GETSOCKNAME_SYSCALL	1

OK. Assume it in the generic linux support.

>  
>  /* Support for SysV IPC through wired syscalls.  All supported architectures
>     either support ipc syscall and/or all the ipc correspondent syscalls.  */
> diff --git a/sysdeps/unix/sysv/linux/m68k/kernel-features.h b/sysdeps/unix/sysv/linux/m68k/kernel-features.h
> index 55b8958fb2..b8f8e48c8a 100644
> --- a/sysdeps/unix/sysv/linux/m68k/kernel-features.h
> +++ b/sysdeps/unix/sysv/linux/m68k/kernel-features.h
> @@ -19,7 +19,6 @@
>  
>  /* Direct socketcalls available with kernel 4.3.  */
>  #if __LINUX_KERNEL_VERSION >= 0x040300
> -# define __ASSUME_GETSOCKNAME_SYSCALL        1

OK. Remove.

>  # define __ASSUME_GETPEERNAME_SYSCALL        1
>  #endif
>  
> @@ -44,6 +43,7 @@
>  # undef __ASSUME_SOCKETPAIR_SYSCALL
>  # undef __ASSUME_LISTEN_SYSCALL
>  # undef __ASSUME_SHUTDOWN_SYSCALL
> +# undef __ASSUME_GETSOCKNAME_SYSCALL

OK.

>  #endif
>  
>  /* No support for PI futexes or robust mutexes before 3.10 for m68k.  */
> diff --git a/sysdeps/unix/sysv/linux/microblaze/kernel-features.h b/sysdeps/unix/sysv/linux/microblaze/kernel-features.h
> index 9ee6c621ee..12f9a55b03 100644
> --- a/sysdeps/unix/sysv/linux/microblaze/kernel-features.h
> +++ b/sysdeps/unix/sysv/linux/microblaze/kernel-features.h
> @@ -19,7 +19,6 @@
>  
>  /* All supported kernel versions for MicroBlaze have these syscalls.  */
>  #define __ASSUME_CONNECT_SYSCALL	1
> -#define __ASSUME_GETSOCKNAME_SYSCALL	1

OK. This one isn't even needed after the refactor.

>  #define __ASSUME_GETPEERNAME_SYSCALL	1
>  #define __ASSUME_SEND_SYSCALL		1
>  #define __ASSUME_RECV_SYSCALL		1
> diff --git a/sysdeps/unix/sysv/linux/powerpc/kernel-features.h b/sysdeps/unix/sysv/linux/powerpc/kernel-features.h
> index ad9eb340b5..852bac0313 100644
> --- a/sysdeps/unix/sysv/linux/powerpc/kernel-features.h
> +++ b/sysdeps/unix/sysv/linux/powerpc/kernel-features.h
> @@ -19,7 +19,6 @@
>  
>  /* New syscalls added for PowerPC in 2.6.37.  */
>  #define __ASSUME_CONNECT_SYSCALL	1
> -#define __ASSUME_GETSOCKNAME_SYSCALL	1

OK. Likewise.

>  #define __ASSUME_GETPEERNAME_SYSCALL	1
>  #define __ASSUME_SEND_SYSCALL		1
>  #define __ASSUME_RECV_SYSCALL		1
> diff --git a/sysdeps/unix/sysv/linux/s390/kernel-features.h b/sysdeps/unix/sysv/linux/s390/kernel-features.h
> index e47c628f51..3a3942fa68 100644
> --- a/sysdeps/unix/sysv/linux/s390/kernel-features.h
> +++ b/sysdeps/unix/sysv/linux/s390/kernel-features.h
> @@ -19,7 +19,6 @@
>  
>  /* Direct socketcalls available with kernel 4.3.  */
>  #if __LINUX_KERNEL_VERSION >= 0x040300
> -# define __ASSUME_GETSOCKNAME_SYSCALL        1

OK.

>  # define __ASSUME_GETPEERNAME_SYSCALL        1
>  #endif
>  
> @@ -44,6 +43,7 @@
>  # undef __ASSUME_SOCKETPAIR_SYSCALL
>  # undef __ASSUME_LISTEN_SYSCALL
>  # undef __ASSUME_SHUTDOWN_SYSCALL
> +# undef __ASSUME_GETSOCKNAME_SYSCALL

OK.

>  #endif
>  
>  /* s390 only supports ipc syscall before 5.1.  */
> diff --git a/sysdeps/unix/sysv/linux/sh/kernel-features.h b/sysdeps/unix/sysv/linux/sh/kernel-features.h
> index 0ab656d58e..7a15569dfc 100644
> --- a/sysdeps/unix/sysv/linux/sh/kernel-features.h
> +++ b/sysdeps/unix/sysv/linux/sh/kernel-features.h
> @@ -24,7 +24,6 @@
>  
>  /* These syscalls were added for SH in 2.6.37.  */
>  #define __ASSUME_CONNECT_SYSCALL	1
> -#define __ASSUME_GETSOCKNAME_SYSCALL	1

OK. Not needed.

>  #define __ASSUME_GETPEERNAME_SYSCALL	1
>  #define __ASSUME_SEND_SYSCALL		1
>  #define __ASSUME_RECV_SYSCALL		1
> diff --git a/sysdeps/unix/sysv/linux/sparc/kernel-features.h b/sysdeps/unix/sysv/linux/sparc/kernel-features.h
> index 12e98a9f95..8ada43587b 100644
> --- a/sysdeps/unix/sysv/linux/sparc/kernel-features.h
> +++ b/sysdeps/unix/sysv/linux/sparc/kernel-features.h
> @@ -42,6 +42,12 @@
>  # undef __ASSUME_SETSOCKOPT_SYSCALL
>  #endif
>  
> +/* There syscalls were added for 32-bit in compat syscall table only
> +   in 4.20 (but present for 64-bit in all supported kernel versions).  */
> +#if !defined __arch64__ && __LINUX_KERNEL_VERSION < 0x041400
> +# undef __ASSUME_GETSOCKNAME_SYSCALL
> +#endif

OK.

> +
>  /* These syscalls were added for both 32-bit and 64-bit in 4.4.  */
>  #if __LINUX_KERNEL_VERSION < 0x040400
>  # undef __ASSUME_BIND_SYSCALL

-- 
Cheers,
Carlos.


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

* Re: [PATCH v2 3/5] Linux: Assume and consolidate getpeername wire-up syscall
  2022-12-07 21:22 ` [PATCH v2 3/5] Linux: Assume and consolidate getpeername " Adhemerval Zanella via Libc-alpha
@ 2023-02-19 21:23   ` Carlos O'Donell via Libc-alpha
  0 siblings, 0 replies; 11+ messages in thread
From: Carlos O'Donell via Libc-alpha @ 2023-02-19 21:23 UTC (permalink / raw)
  To: Adhemerval Zanella, libc-alpha

On 12/7/22 16:22, Adhemerval Zanella wrote:
> And disable if kernel does not support it.
> 
> Checked on x86_64-linux-gnu and i686-linux-gnu.

LGTM.

Reviewed-by: Carlos O'Donell <carlos@redhat.com>
Tested-by: Carlos O'Donell <carlos@redhat.com>

> ---
>  sysdeps/unix/sysv/linux/generic/syscalls.list        | 4 ----
>  sysdeps/unix/sysv/linux/getpeername.c                | 7 +------
>  sysdeps/unix/sysv/linux/i386/kernel-features.h       | 6 +-----
>  sysdeps/unix/sysv/linux/kernel-features.h            | 1 +
>  sysdeps/unix/sysv/linux/m68k/kernel-features.h       | 6 +-----
>  sysdeps/unix/sysv/linux/microblaze/kernel-features.h | 1 -
>  sysdeps/unix/sysv/linux/powerpc/kernel-features.h    | 1 -
>  sysdeps/unix/sysv/linux/s390/kernel-features.h       | 6 +-----
>  sysdeps/unix/sysv/linux/sh/kernel-features.h         | 1 -
>  sysdeps/unix/sysv/linux/sparc/kernel-features.h      | 1 +
>  10 files changed, 6 insertions(+), 28 deletions(-)
>  delete mode 100644 sysdeps/unix/sysv/linux/generic/syscalls.list
> 
> diff --git a/sysdeps/unix/sysv/linux/generic/syscalls.list b/sysdeps/unix/sysv/linux/generic/syscalls.list
> deleted file mode 100644
> index e89ce91ac0..0000000000
> --- a/sysdeps/unix/sysv/linux/generic/syscalls.list
> +++ /dev/null
> @@ -1,4 +0,0 @@
> -# File name	Caller	Syscall name	# args	Strong name	Weak names
> -
> -# Socket APIs
> -getpeername	-	getpeername	i:ipp	__getpeername	getpeername

OK. Remove getpeername from syscalls.list. Use the generic version C file.

> diff --git a/sysdeps/unix/sysv/linux/getpeername.c b/sysdeps/unix/sysv/linux/getpeername.c
> index 09ca76b9ad..63fa8e2fe5 100644
> --- a/sysdeps/unix/sysv/linux/getpeername.c
> +++ b/sysdeps/unix/sysv/linux/getpeername.c
> @@ -15,19 +15,14 @@
>     License along with the GNU C Library; if not, see
>     <https://www.gnu.org/licenses/>.  */
>  
> -#include <errno.h>
> -#include <signal.h>
>  #include <sys/socket.h>
> -
>  #include <socketcall.h>
> -#include <kernel-features.h>
> -#include <sys/syscall.h>
>  
>  int
>  __getpeername (int fd, __SOCKADDR_ARG addr, socklen_t *len)
>  {
>  #ifdef __ASSUME_GETPEERNAME_SYSCALL
> -  return INLINE_SYSCALL (getpeername, 3, fd, addr.__sockaddr__, len);
> +  return INLINE_SYSCALL_CALL (getpeername, fd, addr.__sockaddr__, len);

OK.

>  #else
>    return SOCKETCALL (getpeername, fd, addr.__sockaddr__, len);
>  #endif
> diff --git a/sysdeps/unix/sysv/linux/i386/kernel-features.h b/sysdeps/unix/sysv/linux/i386/kernel-features.h
> index 0c949349e1..d3d5376b92 100644
> --- a/sysdeps/unix/sysv/linux/i386/kernel-features.h
> +++ b/sysdeps/unix/sysv/linux/i386/kernel-features.h
> @@ -17,11 +17,6 @@
>     License along with the GNU C Library; if not, see
>     <https://www.gnu.org/licenses/>.  */
>  
> -/* Direct socketcalls available with kernel 4.3.  */
> -#if __LINUX_KERNEL_VERSION >= 0x040300
> -# define __ASSUME_GETPEERNAME_SYSCALL        1
> -#endif
> -

OK. Remove check, and refactor meaning.

>  #include_next <kernel-features.h>
>  
>  #undef __ASSUME_ACCEPT_SYSCALL
> @@ -42,6 +37,7 @@
>  # undef __ASSUME_LISTEN_SYSCALL
>  # undef __ASSUME_SHUTDOWN_SYSCALL
>  # undef __ASSUME_GETSOCKNAME_SYSCALL
> +# undef __ASSUME_GETPEERNAME_SYSCALL

OK. Undefine in < 4.3 kernel.

>  #endif
>  
>  /* i686 only supports ipc syscall before 5.1.  */
> diff --git a/sysdeps/unix/sysv/linux/kernel-features.h b/sysdeps/unix/sysv/linux/kernel-features.h
> index cac8708050..403223c565 100644
> --- a/sysdeps/unix/sysv/linux/kernel-features.h
> +++ b/sysdeps/unix/sysv/linux/kernel-features.h
> @@ -85,6 +85,7 @@
>  #define __ASSUME_LISTEN_SYSCALL		1
>  #define __ASSUME_SHUTDOWN_SYSCALL	1
>  #define __ASSUME_GETSOCKNAME_SYSCALL	1
> +#define __ASSUME_GETPEERNAME_SYSCALL	1

OK. Defined by default.

>  
>  /* Support for SysV IPC through wired syscalls.  All supported architectures
>     either support ipc syscall and/or all the ipc correspondent syscalls.  */
> diff --git a/sysdeps/unix/sysv/linux/m68k/kernel-features.h b/sysdeps/unix/sysv/linux/m68k/kernel-features.h
> index b8f8e48c8a..6f7f4b2481 100644
> --- a/sysdeps/unix/sysv/linux/m68k/kernel-features.h
> +++ b/sysdeps/unix/sysv/linux/m68k/kernel-features.h
> @@ -17,11 +17,6 @@
>     License along with the GNU C Library.  If not, see
>     <https://www.gnu.org/licenses/>.  */
>  
> -/* Direct socketcalls available with kernel 4.3.  */
> -#if __LINUX_KERNEL_VERSION >= 0x040300
> -# define __ASSUME_GETPEERNAME_SYSCALL        1
> -#endif

OK.

> -
>  #include_next <kernel-features.h>
>  
>  #undef __ASSUME_ACCEPT_SYSCALL
> @@ -44,6 +39,7 @@
>  # undef __ASSUME_LISTEN_SYSCALL
>  # undef __ASSUME_SHUTDOWN_SYSCALL
>  # undef __ASSUME_GETSOCKNAME_SYSCALL
> +# undef __ASSUME_GETPEERNAME_SYSCALL

OK.

>  #endif
>  
>  /* No support for PI futexes or robust mutexes before 3.10 for m68k.  */
> diff --git a/sysdeps/unix/sysv/linux/microblaze/kernel-features.h b/sysdeps/unix/sysv/linux/microblaze/kernel-features.h
> index 12f9a55b03..72496aa922 100644
> --- a/sysdeps/unix/sysv/linux/microblaze/kernel-features.h
> +++ b/sysdeps/unix/sysv/linux/microblaze/kernel-features.h
> @@ -19,7 +19,6 @@
>  
>  /* All supported kernel versions for MicroBlaze have these syscalls.  */
>  #define __ASSUME_CONNECT_SYSCALL	1
> -#define __ASSUME_GETPEERNAME_SYSCALL	1

OK. Not needed since linux generic defines it.

>  #define __ASSUME_SEND_SYSCALL		1
>  #define __ASSUME_RECV_SYSCALL		1
>  
> diff --git a/sysdeps/unix/sysv/linux/powerpc/kernel-features.h b/sysdeps/unix/sysv/linux/powerpc/kernel-features.h
> index 852bac0313..e2dc7a15a3 100644
> --- a/sysdeps/unix/sysv/linux/powerpc/kernel-features.h
> +++ b/sysdeps/unix/sysv/linux/powerpc/kernel-features.h
> @@ -19,7 +19,6 @@
>  
>  /* New syscalls added for PowerPC in 2.6.37.  */
>  #define __ASSUME_CONNECT_SYSCALL	1
> -#define __ASSUME_GETPEERNAME_SYSCALL	1

OK. Likewise.

>  #define __ASSUME_SEND_SYSCALL		1
>  #define __ASSUME_RECV_SYSCALL		1
>  
> diff --git a/sysdeps/unix/sysv/linux/s390/kernel-features.h b/sysdeps/unix/sysv/linux/s390/kernel-features.h
> index 3a3942fa68..254b3948f4 100644
> --- a/sysdeps/unix/sysv/linux/s390/kernel-features.h
> +++ b/sysdeps/unix/sysv/linux/s390/kernel-features.h
> @@ -17,11 +17,6 @@
>     License along with the GNU C Library; if not, see
>     <https://www.gnu.org/licenses/>.  */
>  
> -/* Direct socketcalls available with kernel 4.3.  */
> -#if __LINUX_KERNEL_VERSION >= 0x040300
> -# define __ASSUME_GETPEERNAME_SYSCALL        1
> -#endif
> -

OK.

>  #include_next <kernel-features.h>
>  
>  #undef __ASSUME_ACCEPT_SYSCALL
> @@ -44,6 +39,7 @@
>  # undef __ASSUME_LISTEN_SYSCALL
>  # undef __ASSUME_SHUTDOWN_SYSCALL
>  # undef __ASSUME_GETSOCKNAME_SYSCALL
> +# undef __ASSUME_GETPEERNAME_SYSCALL

OK.

>  #endif
>  
>  /* s390 only supports ipc syscall before 5.1.  */
> diff --git a/sysdeps/unix/sysv/linux/sh/kernel-features.h b/sysdeps/unix/sysv/linux/sh/kernel-features.h
> index 7a15569dfc..ae1387e7d7 100644
> --- a/sysdeps/unix/sysv/linux/sh/kernel-features.h
> +++ b/sysdeps/unix/sysv/linux/sh/kernel-features.h
> @@ -24,7 +24,6 @@
>  
>  /* These syscalls were added for SH in 2.6.37.  */
>  #define __ASSUME_CONNECT_SYSCALL	1
> -#define __ASSUME_GETPEERNAME_SYSCALL	1

OK. Not needed.

>  #define __ASSUME_SEND_SYSCALL		1
>  #define __ASSUME_RECV_SYSCALL		1
>  
> diff --git a/sysdeps/unix/sysv/linux/sparc/kernel-features.h b/sysdeps/unix/sysv/linux/sparc/kernel-features.h
> index 8ada43587b..3ecaf36005 100644
> --- a/sysdeps/unix/sysv/linux/sparc/kernel-features.h
> +++ b/sysdeps/unix/sysv/linux/sparc/kernel-features.h
> @@ -46,6 +46,7 @@
>     in 4.20 (but present for 64-bit in all supported kernel versions).  */
>  #if !defined __arch64__ && __LINUX_KERNEL_VERSION < 0x041400
>  # undef __ASSUME_GETSOCKNAME_SYSCALL
> +# undef __ASSUME_GETPEERNAME_SYSCALL

OK.

>  #endif
>  
>  /* These syscalls were added for both 32-bit and 64-bit in 4.4.  */

-- 
Cheers,
Carlos.


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

* Re: [PATCH v2 4/5] Linux: Remove unused generic Makefile
  2022-12-07 21:22 ` [PATCH v2 4/5] Linux: Remove unused generic Makefile Adhemerval Zanella via Libc-alpha
@ 2023-02-19 21:27   ` Carlos O'Donell via Libc-alpha
  0 siblings, 0 replies; 11+ messages in thread
From: Carlos O'Donell via Libc-alpha @ 2023-02-19 21:27 UTC (permalink / raw)
  To: Adhemerval Zanella, libc-alpha

On 12/7/22 16:22, Adhemerval Zanella wrote:
> Both are already defined on default linux Makefile.

The commit message and the changes are all correct, but two of
the hunks were committed as part of the fix for commit
c1c0dea38833751f36a145c322ce53c9a08332e1.

I tested with:
diff --git a/sysdeps/unix/sysv/linux/generic/Makefile b/sysdeps/unix/sysv/linux/generic/Makefile
deleted file mode 100644
index 7e27e79772..0000000000
--- a/sysdeps/unix/sysv/linux/generic/Makefile
+++ /dev/null
@@ -1,3 +0,0 @@
-ifeq ($(subdir),misc)
-sysdep_routines += epoll_create inotify_init
-endif

The following rb and tb are conditional on this commit dropping
those changes. You can therefore carry my rb+tb when you repost
v3 and push v3.

LGTM.

Reviewed-by: Carlos O'Donell <carlos@redhat.com>
Tested-by: Carlos O'Donell <carlos@redhat.com>

> ---
>  sysdeps/unix/sysv/linux/Makefile         | 2 ++
>  sysdeps/unix/sysv/linux/generic/Makefile | 3 ---
>  sysdeps/unix/sysv/linux/syscalls.list    | 2 --
>  3 files changed, 2 insertions(+), 5 deletions(-)
>  delete mode 100644 sysdeps/unix/sysv/linux/generic/Makefile
> 
> diff --git a/sysdeps/unix/sysv/linux/Makefile b/sysdeps/unix/sysv/linux/Makefile
> index 60e4cb1521..632b49e9ec 100644
> --- a/sysdeps/unix/sysv/linux/Makefile
> +++ b/sysdeps/unix/sysv/linux/Makefile
> @@ -69,6 +69,8 @@ sysdep_routines += adjtimex clone umount umount2 readahead sysctl \
>  		   clone3 clone-internal \
>  		   fanotify_mark \
>  		   mremap \
> +		   epoll_create \
> +		   inotify_init

Not needed anymore (commit c1c0dea38833751f36a145c322ce53c9a08332e1)

>  
>  CFLAGS-gethostid.c = -fexceptions
>  CFLAGS-tee.c = -fexceptions -fasynchronous-unwind-tables
> diff --git a/sysdeps/unix/sysv/linux/generic/Makefile b/sysdeps/unix/sysv/linux/generic/Makefile
> deleted file mode 100644
> index 7e27e79772..0000000000
> --- a/sysdeps/unix/sysv/linux/generic/Makefile
> +++ /dev/null
> @@ -1,3 +0,0 @@
> -ifeq ($(subdir),misc)
> -sysdep_routines += epoll_create inotify_init
> -endif

Still needed.

> diff --git a/sysdeps/unix/sysv/linux/syscalls.list b/sysdeps/unix/sysv/linux/syscalls.list
> index b9f45463c5..73e941ef89 100644
> --- a/sysdeps/unix/sysv/linux/syscalls.list
> +++ b/sysdeps/unix/sysv/linux/syscalls.list
> @@ -6,7 +6,6 @@ capget		EXTRA	capget		i:pp	capget
>  capset		EXTRA	capset		i:pp	capset
>  create_module	EXTRA	create_module	3	__compat_create_module	create_module@GLIBC_2.0:GLIBC_2.23
>  delete_module	EXTRA	delete_module	3	delete_module
> -epoll_create	EXTRA	epoll_create	i:i	epoll_create
>  epoll_create1	EXTRA	epoll_create1	i:i	epoll_create1
>  epoll_ctl	EXTRA	epoll_ctl	i:iiip	epoll_ctl
>  eventfd		EXTRA	eventfd2	i:ii	eventfd
> @@ -28,7 +27,6 @@ getresgid	-	getresgid	i:ppp	getresgid
>  getsid		-	getsid		i:i	getsid
>  init_module	EXTRA	init_module	5	init_module
>  inotify_add_watch	EXTRA	inotify_add_watch	i:isi	inotify_add_watch
> -inotify_init	EXTRA	inotify_init	i:	inotify_init
>  inotify_init1	EXTRA	inotify_init1	i:I	inotify_init1
>  inotify_rm_watch	EXTRA	inotify_rm_watch	i:ii	inotify_rm_watch
>  ioperm		-	ioperm		i:UUi	ioperm

Not needed anymore (commit c1c0dea38833751f36a145c322ce53c9a08332e1).

-- 
Cheers,
Carlos.


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

* Re: [PATCH v2 0/5] Remove Linux generic sysdep
  2022-12-07 21:22 [PATCH v2 0/5] Remove Linux generic sysdep Adhemerval Zanella via Libc-alpha
                   ` (4 preceding siblings ...)
  2022-12-08 12:46 ` [PATCH v2 5/5] Linux: Remove generic Implies Adhemerval Zanella via Libc-alpha
@ 2023-02-19 21:29 ` Carlos O'Donell via Libc-alpha
  5 siblings, 0 replies; 11+ messages in thread
From: Carlos O'Donell via Libc-alpha @ 2023-02-19 21:29 UTC (permalink / raw)
  To: Adhemerval Zanella, libc-alpha

On 12/7/22 16:22, Adhemerval Zanella wrote:
> With recent BZ#29657, where struct stat were not adapted for 64 time
> because I forgot that generic folder is not always used for ports with
> default 64 bit time_t; it seems better to finish the generic
> integration and make the Linux default implementation the de-facto
> "generic" implementation.

I reviewed the oustanding patches and I think this is ready to go in.

I suggest:
- Post v3 with my rb+tb carried forward (requires a rebase of one patch).
- Push v3.
- Mark v2 as superseded.
 
> Changes for v2:
> - Fixed sparc32 getsockname and getpeername kernel definition.
> - Added epoll_create and inotify_init Makefile rules.
> - Expanded commits messages.
> 
> Adhemerval Zanella (5):
>   Linux: Move wordsize-32 Version to default
>   Linux: Assume and consolidate getsockname wire-up syscall
>   Linux: Assume and consolidate getpeername wire-up syscall
>   Linux: Remove unused generic Makefile
>   Linux: Remove generic Implies
> 
>  sysdeps/unix/sysv/linux/Makefile                     |  2 ++
>  sysdeps/unix/sysv/linux/Versions                     |  3 +++
>  sysdeps/unix/sysv/linux/aarch64/Implies              |  1 -
>  sysdeps/unix/sysv/linux/arc/Implies                  |  2 --
>  sysdeps/unix/sysv/linux/arm/Versions                 |  3 ---
>  sysdeps/unix/sysv/linux/csky/Implies                 |  2 --
>  sysdeps/unix/sysv/linux/generic/Makefile             |  3 ---
>  sysdeps/unix/sysv/linux/generic/README               | 11 -----------
>  sysdeps/unix/sysv/linux/generic/syscalls.list        |  5 -----
>  sysdeps/unix/sysv/linux/generic/wordsize-32/Versions |  5 -----
>  sysdeps/unix/sysv/linux/getpeername.c                |  7 +------
>  sysdeps/unix/sysv/linux/getsockname.c                |  7 +------
>  sysdeps/unix/sysv/linux/hppa/Versions                |  3 ---
>  sysdeps/unix/sysv/linux/i386/Versions                |  4 ----
>  sysdeps/unix/sysv/linux/i386/kernel-features.h       |  8 ++------
>  sysdeps/unix/sysv/linux/kernel-features.h            |  2 ++
>  sysdeps/unix/sysv/linux/loongarch/lp64/Implies       |  1 -
>  sysdeps/unix/sysv/linux/m68k/Versions                |  3 ---
>  sysdeps/unix/sysv/linux/m68k/kernel-features.h       |  8 ++------
>  sysdeps/unix/sysv/linux/microblaze/Versions          |  5 -----
>  sysdeps/unix/sysv/linux/microblaze/kernel-features.h |  2 --
>  sysdeps/unix/sysv/linux/mips/Versions                |  3 ---
>  sysdeps/unix/sysv/linux/nios2/Implies                |  2 --
>  sysdeps/unix/sysv/linux/or1k/Implies                 |  2 --
>  sysdeps/unix/sysv/linux/powerpc/kernel-features.h    |  2 --
>  sysdeps/unix/sysv/linux/powerpc/powerpc32/Versions   |  3 ---
>  sysdeps/unix/sysv/linux/riscv/rv32/Implies           |  2 --
>  sysdeps/unix/sysv/linux/riscv/rv64/Implies           |  1 -
>  sysdeps/unix/sysv/linux/s390/kernel-features.h       |  8 ++------
>  sysdeps/unix/sysv/linux/s390/s390-32/Versions        |  3 ---
>  sysdeps/unix/sysv/linux/sh/Versions                  |  3 ---
>  sysdeps/unix/sysv/linux/sh/kernel-features.h         |  2 --
>  sysdeps/unix/sysv/linux/sparc/kernel-features.h      |  7 +++++++
>  sysdeps/unix/sysv/linux/sparc/sparc32/Versions       |  3 ---
>  sysdeps/unix/sysv/linux/syscalls.list                |  2 --
>  35 files changed, 22 insertions(+), 108 deletions(-)
>  delete mode 100644 sysdeps/unix/sysv/linux/generic/Makefile
>  delete mode 100644 sysdeps/unix/sysv/linux/generic/README
>  delete mode 100644 sysdeps/unix/sysv/linux/generic/syscalls.list
>  delete mode 100644 sysdeps/unix/sysv/linux/generic/wordsize-32/Versions
>  delete mode 100644 sysdeps/unix/sysv/linux/microblaze/Versions
> 

-- 
Cheers,
Carlos.


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

end of thread, other threads:[~2023-02-20 13:34 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-12-07 21:22 [PATCH v2 0/5] Remove Linux generic sysdep Adhemerval Zanella via Libc-alpha
2022-12-07 21:22 ` [PATCH v2 1/5] Linux: Move wordsize-32 Version to default Adhemerval Zanella via Libc-alpha
2023-02-19 21:11   ` Carlos O'Donell via Libc-alpha
2022-12-07 21:22 ` [PATCH v2 2/5] Linux: Assume and consolidate getsockname wire-up syscall Adhemerval Zanella via Libc-alpha
2023-02-19 21:20   ` Carlos O'Donell via Libc-alpha
2022-12-07 21:22 ` [PATCH v2 3/5] Linux: Assume and consolidate getpeername " Adhemerval Zanella via Libc-alpha
2023-02-19 21:23   ` Carlos O'Donell via Libc-alpha
2022-12-07 21:22 ` [PATCH v2 4/5] Linux: Remove unused generic Makefile Adhemerval Zanella via Libc-alpha
2023-02-19 21:27   ` Carlos O'Donell via Libc-alpha
2022-12-08 12:46 ` [PATCH v2 5/5] Linux: Remove generic Implies Adhemerval Zanella via Libc-alpha
2023-02-19 21:29 ` [PATCH v2 0/5] Remove Linux generic sysdep Carlos O'Donell via Libc-alpha

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).