public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
* [PATCH v3 0/5] Remove Linux generic sysdep
@ 2023-02-20 14:29 Adhemerval Zanella
  2023-02-20 14:29 ` [PATCH v3 1/5] Linux: Move wordsize-32 Version to default Adhemerval Zanella
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: Adhemerval Zanella @ 2023-02-20 14:29 UTC (permalink / raw)
  To: libc-alpha

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 v3:
- Fixed commit message.
- Remove rb+tb carried forward.

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/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 ---
 33 files changed, 20 insertions(+), 106 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] 6+ messages in thread

* [PATCH v3 1/5] Linux: Move wordsize-32 Version to default
  2023-02-20 14:29 [PATCH v3 0/5] Remove Linux generic sysdep Adhemerval Zanella
@ 2023-02-20 14:29 ` Adhemerval Zanella
  2023-02-20 14:29 ` [PATCH v3 2/5] Linux: Assume and consolidate getsockname wire-up syscall Adhemerval Zanella
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: Adhemerval Zanella @ 2023-02-20 14:29 UTC (permalink / raw)
  To: libc-alpha; +Cc: Carlos O'Donell

And remove redundant entries on other architectures Version.  The
version for fallocate64 was supposed to be 2.10, but it 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).

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

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;
+  }
   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	[flat|nested] 6+ messages in thread

* [PATCH v3 2/5] Linux: Assume and consolidate getsockname wire-up syscall
  2023-02-20 14:29 [PATCH v3 0/5] Remove Linux generic sysdep Adhemerval Zanella
  2023-02-20 14:29 ` [PATCH v3 1/5] Linux: Move wordsize-32 Version to default Adhemerval Zanella
@ 2023-02-20 14:29 ` Adhemerval Zanella
  2023-02-20 14:29 ` [PATCH v3 3/5] Linux: Assume and consolidate getpeername " Adhemerval Zanella
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: Adhemerval Zanella @ 2023-02-20 14:29 UTC (permalink / raw)
  To: libc-alpha; +Cc: Carlos O'Donell

And disable if kernel does not support it.

Checked on x86_64-linux-gnu and i686-linux-gnu.

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
 getpeername	-	getpeername	i:ipp	__getpeername	getpeername
diff --git a/sysdeps/unix/sysv/linux/getsockname.c b/sysdeps/unix/sysv/linux/getsockname.c
index 38e6f2dac6..61973fa5cd 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 334a31a0e5..1c5cbd3351 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 4b5c4afbc1..4a4d624aeb 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 2d9b225249..e57f09a74e 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 e5bfa05491..10eff56743 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 2b3cbd05c1..231742a5c3 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 7ca9393942..058b211e55 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 931f1c8834..76e2de7bf5 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 279fa93a3b..f71aa8ca38 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	[flat|nested] 6+ messages in thread

* [PATCH v3 3/5] Linux: Assume and consolidate getpeername wire-up syscall
  2023-02-20 14:29 [PATCH v3 0/5] Remove Linux generic sysdep Adhemerval Zanella
  2023-02-20 14:29 ` [PATCH v3 1/5] Linux: Move wordsize-32 Version to default Adhemerval Zanella
  2023-02-20 14:29 ` [PATCH v3 2/5] Linux: Assume and consolidate getsockname wire-up syscall Adhemerval Zanella
@ 2023-02-20 14:29 ` Adhemerval Zanella
  2023-02-20 14:29 ` [PATCH v3 4/5] Linux: Remove unused generic Makefile Adhemerval Zanella
  2023-02-20 14:29 ` [PATCH v3 5/5] Linux: Remove generic Implies Adhemerval Zanella
  4 siblings, 0 replies; 6+ messages in thread
From: Adhemerval Zanella @ 2023-02-20 14:29 UTC (permalink / raw)
  To: libc-alpha; +Cc: Carlos O'Donell

And disable if kernel does not support it.

Checked on x86_64-linux-gnu and i686-linux-gnu.

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
diff --git a/sysdeps/unix/sysv/linux/getpeername.c b/sysdeps/unix/sysv/linux/getpeername.c
index eb49d40d3a..827fd631dc 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 1c5cbd3351..ed7efa3097 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 4a4d624aeb..07b440f4ee 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 e57f09a74e..d0155783b7 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 10eff56743..3d6270b633 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 231742a5c3..e092d3bd24 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 058b211e55..fb87a57a15 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 76e2de7bf5..953fa8dff0 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 f71aa8ca38..98c938c16d 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	[flat|nested] 6+ messages in thread

* [PATCH v3 4/5] Linux: Remove unused generic Makefile
  2023-02-20 14:29 [PATCH v3 0/5] Remove Linux generic sysdep Adhemerval Zanella
                   ` (2 preceding siblings ...)
  2023-02-20 14:29 ` [PATCH v3 3/5] Linux: Assume and consolidate getpeername " Adhemerval Zanella
@ 2023-02-20 14:29 ` Adhemerval Zanella
  2023-02-20 14:29 ` [PATCH v3 5/5] Linux: Remove generic Implies Adhemerval Zanella
  4 siblings, 0 replies; 6+ messages in thread
From: Adhemerval Zanella @ 2023-02-20 14:29 UTC (permalink / raw)
  To: libc-alpha; +Cc: Carlos O'Donell

Both are already defined on default linux Makefile.

Reviewed-by: Carlos O'Donell <carlos@redhat.com>
Tested-by: Carlos O'Donell <carlos@redhat.com>
---
 sysdeps/unix/sysv/linux/generic/Makefile | 3 ---
 1 file changed, 3 deletions(-)
 delete mode 100644 sysdeps/unix/sysv/linux/generic/Makefile

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
-- 
2.34.1


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

* [PATCH v3 5/5] Linux: Remove generic Implies
  2023-02-20 14:29 [PATCH v3 0/5] Remove Linux generic sysdep Adhemerval Zanella
                   ` (3 preceding siblings ...)
  2023-02-20 14:29 ` [PATCH v3 4/5] Linux: Remove unused generic Makefile Adhemerval Zanella
@ 2023-02-20 14:29 ` Adhemerval Zanella
  4 siblings, 0 replies; 6+ messages in thread
From: Adhemerval Zanella @ 2023-02-20 14:29 UTC (permalink / raw)
  To: libc-alpha; +Cc: 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	[flat|nested] 6+ messages in thread

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

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-02-20 14:29 [PATCH v3 0/5] Remove Linux generic sysdep Adhemerval Zanella
2023-02-20 14:29 ` [PATCH v3 1/5] Linux: Move wordsize-32 Version to default Adhemerval Zanella
2023-02-20 14:29 ` [PATCH v3 2/5] Linux: Assume and consolidate getsockname wire-up syscall Adhemerval Zanella
2023-02-20 14:29 ` [PATCH v3 3/5] Linux: Assume and consolidate getpeername " Adhemerval Zanella
2023-02-20 14:29 ` [PATCH v3 4/5] Linux: Remove unused generic Makefile Adhemerval Zanella
2023-02-20 14:29 ` [PATCH v3 5/5] Linux: Remove generic Implies Adhemerval Zanella

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