From patchwork Wed Nov 18 19:55:25 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adhemerval Zanella Netto X-Patchwork-Id: 41101 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 11823393C87E; Wed, 18 Nov 2020 19:56:05 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 11823393C87E DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1605729365; bh=gAAZxXS0idn8Sj6JUqIiDH9QtW9qud3wzzvaFbQExxs=; h=To:Subject:Date:In-Reply-To:References:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=DVne0NSGEugaXCKFAO5ZLeudcFK1PmEvJvT3STP+TCGZKx2wfysLSx+0vRzICJsNg Je5cov2+7XYZftJNY39mCrH7hHYRFvuKTFqRZ8NU3dDcdZWCqvu/etVhZ8yY1TpBcp drpXtSfccDvGLMDQIcFlXp+TYAf14nuKQtzpAd70= X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from mail-qk1-x743.google.com (mail-qk1-x743.google.com [IPv6:2607:f8b0:4864:20::743]) by sourceware.org (Postfix) with ESMTPS id 6440C3854800 for ; Wed, 18 Nov 2020 19:56:00 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 6440C3854800 Received: by mail-qk1-x743.google.com with SMTP id v143so3105004qkb.2 for ; Wed, 18 Nov 2020 11:56:00 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=gAAZxXS0idn8Sj6JUqIiDH9QtW9qud3wzzvaFbQExxs=; b=dIocf/g3HzuAgxUJKBdoClyQbN6jClGHDlk7zSn2H43unsR3iR7dWT+4ZuI4CydXt4 dgpMSvuKDFq+lksaYeyZPBlnPI/fO5tDMH8b6ysjTJE1mJELGp3cDw2VcU+AEx5KYT5M QCpGwaoCZr10ViJ73XoRt/aXhg0l8AoQJOhzCqexiNoByeCCAN8g0fuJX0Fe1wS5k2HX pcmJoK6Nbm0/gepd8oka+DElH9fOtXBEctxrbOSQB+tOaWaGGNctevm02Y5DePKknJg9 NqSm28iYY9cTLzHJ0blhgDjLzvd+s42RnOEgB7QtITpM54NXgPivBluezf3LmWZaAi0p Cj8g== X-Gm-Message-State: AOAM5315Gc3EcZRs7dFb0+vgD0zmNsEcBdgWvBQhgkGWrbPXfYu1u7mJ TRxkQstjSpvTAXZVamUGbABTHs8kTUfqMA== X-Google-Smtp-Source: ABdhPJzTmuRFh0qEiQdMEF16iqBAIlnum1yitoe4LF0Vs2ZJvtoJUGooTZo+T0c1PvYJ9moJvostzA== X-Received: by 2002:a37:40c:: with SMTP id 12mr6217078qke.363.1605729359801; Wed, 18 Nov 2020 11:55:59 -0800 (PST) Received: from localhost.localdomain ([177.194.48.209]) by smtp.googlemail.com with ESMTPSA id f27sm6538775qtv.95.2020.11.18.11.55.58 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 18 Nov 2020 11:55:59 -0800 (PST) To: libc-alpha@sourceware.org Subject: [PATCH 01/28] Remove generic pthread linuxism on POSIX timer_routine Date: Wed, 18 Nov 2020 16:55:25 -0300 Message-Id: <20201118195552.2687336-2-adhemerval.zanella@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20201118195552.2687336-1-adhemerval.zanella@linaro.org> References: <20201118195552.2687336-1-adhemerval.zanella@linaro.org> MIME-Version: 1.0 X-Spam-Status: No, score=-13.9 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Adhemerval Zanella via Libc-alpha From: Adhemerval Zanella Netto Reply-To: Adhemerval Zanella Errors-To: libc-alpha-bounces@sourceware.org Sender: "Libc-alpha" Linux already provide a full implementation, so no need to check if __NR_rt_sigqueueinfo is defined. No semantic changes expected. --- sysdeps/pthread/timer_routines.c | 19 ------------------- 1 file changed, 19 deletions(-) diff --git a/sysdeps/pthread/timer_routines.c b/sysdeps/pthread/timer_routines.c index 05e83d7d52..97f9a2c50c 100644 --- a/sysdeps/pthread/timer_routines.c +++ b/sysdeps/pthread/timer_routines.c @@ -300,30 +300,11 @@ thread_expire_timer (struct thread_node *self, struct timer_node *timer) break; case SIGEV_SIGNAL: -#ifdef __NR_rt_sigqueueinfo - { - siginfo_t info; - - /* First, clear the siginfo_t structure, so that we don't pass our - stack content to other tasks. */ - memset (&info, 0, sizeof (siginfo_t)); - /* We must pass the information about the data in a siginfo_t - value. */ - info.si_signo = timer->event.sigev_signo; - info.si_code = SI_TIMER; - info.si_pid = timer->creator_pid; - info.si_uid = getuid (); - info.si_value = timer->event.sigev_value; - - INLINE_SYSCALL (rt_sigqueueinfo, 3, info.si_pid, info.si_signo, &info); - } -#else if (pthread_kill (self->captured, timer->event.sigev_signo) != 0) { if (pthread_kill (self->id, timer->event.sigev_signo) != 0) abort (); } -#endif break; case SIGEV_THREAD: From patchwork Wed Nov 18 19:55:26 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adhemerval Zanella Netto X-Patchwork-Id: 41100 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 80732393C878; Wed, 18 Nov 2020 19:56:04 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 80732393C878 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1605729364; bh=gxnanqRTyytTmJyz+uzWK+Twq1QQoVPQXIX/hTalfFA=; h=To:Subject:Date:In-Reply-To:References:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=D5OJu30FQw6ko2OzNtZjNIHQeohFnhIuWPUy/0LuJFIw8iPYQanGCQIJLEPxziV9f TBHzfgAulyGwgTT6DT3R+cSWmGMOh1wZT0Wz3eC2lqN0Gc0xfj7P5EJ3+HV0Sg1tQf gHTsxxgUW4TZ3I+ezL2vVQxlbNSwYSIoPlDDXekc= X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from mail-qk1-x730.google.com (mail-qk1-x730.google.com [IPv6:2607:f8b0:4864:20::730]) by sourceware.org (Postfix) with ESMTPS id CCF343894C2D for ; Wed, 18 Nov 2020 19:56:01 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org CCF343894C2D Received: by mail-qk1-x730.google.com with SMTP id y197so3064663qkb.7 for ; Wed, 18 Nov 2020 11:56:01 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=gxnanqRTyytTmJyz+uzWK+Twq1QQoVPQXIX/hTalfFA=; b=Zie/9vxu3vu2ttF3mNcBr4SgV4ZQnOVvvt7LFZCBBfDgBIb9ACm3EIeXDtCyj8d+OJ oDfgvBOn064VDbqyGJGu51VFBuIEt+MhzWdA+hkt2rhbXdqUK4ftWk/kcDeSFzjmFxha 1373Lq2WRB1pEVfNovitNqID8lF4t/9I6RLr8CaSDAPS4ATYrZcnTCzIYupWJ2glgj32 qpqgbNYMn478gsQjzB9oWeTLw9Yv4cC8HVfMj5o8PDnDk5kSOhl+JXASsxfe5ul+KMR1 fKBMHpHpAYGr0G7Ncoq3cE0ec1xeiAzwerdAtHlPrH1Z3nSJujNVzDwpQRxKLNwm4Ig5 ZCVg== X-Gm-Message-State: AOAM533TxyDsIc95ngIHm2wLy6lKQxSJPwW0sQkSELoFu9fO6294Ffp9 ALb9wPG7WPLYPi1Cw1JPSyNp8sTHgsrdXw== X-Google-Smtp-Source: ABdhPJwazasLCb3l8hh+dfmG7d74002g+L4lt6cZwuZqR8J0wYzV6VShTsH13X5Nl0cdJmY4/fLERQ== X-Received: by 2002:a37:813:: with SMTP id 19mr6812348qki.438.1605729361177; Wed, 18 Nov 2020 11:56:01 -0800 (PST) Received: from localhost.localdomain ([177.194.48.209]) by smtp.googlemail.com with ESMTPSA id f27sm6538775qtv.95.2020.11.18.11.56.00 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 18 Nov 2020 11:56:00 -0800 (PST) To: libc-alpha@sourceware.org Subject: [PATCH 02/28] Removed ununsed pthread implementations Date: Wed, 18 Nov 2020 16:55:26 -0300 Message-Id: <20201118195552.2687336-3-adhemerval.zanella@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20201118195552.2687336-1-adhemerval.zanella@linaro.org> References: <20201118195552.2687336-1-adhemerval.zanella@linaro.org> MIME-Version: 1.0 X-Spam-Status: No, score=-13.9 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Adhemerval Zanella via Libc-alpha From: Adhemerval Zanella Netto Reply-To: Adhemerval Zanella Errors-To: libc-alpha-bounces@sourceware.org Sender: "Libc-alpha" The pthread_setuid, pthread_seteuid, pthread_setreuid, pthread_setresuid, pthread_setgid, pthread_setegid, pthread_setregid, and pthread_setresgid are leftovers from linuxthreads. No semantic changes expected. --- nptl/Makefile | 4 ---- nptl/pthread_setegid.c | 3 --- nptl/pthread_seteuid.c | 3 --- nptl/pthread_setgid.c | 3 --- nptl/pthread_setregid.c | 3 --- nptl/pthread_setresgid.c | 3 --- nptl/pthread_setresuid.c | 3 --- nptl/pthread_setreuid.c | 3 --- nptl/pthread_setuid.c | 3 --- 9 files changed, 28 deletions(-) delete mode 100644 nptl/pthread_setegid.c delete mode 100644 nptl/pthread_seteuid.c delete mode 100644 nptl/pthread_setgid.c delete mode 100644 nptl/pthread_setregid.c delete mode 100644 nptl/pthread_setresgid.c delete mode 100644 nptl/pthread_setresuid.c delete mode 100644 nptl/pthread_setreuid.c delete mode 100644 nptl/pthread_setuid.c diff --git a/nptl/Makefile b/nptl/Makefile index 74ab758c12..90611790ef 100644 --- a/nptl/Makefile +++ b/nptl/Makefile @@ -170,10 +170,6 @@ libpthread-routines = nptl-init nptlfreeres vars events version pt-interp \ pthread_setattr_default_np pthread_getattr_default_np \ pthread_mutex_conf \ libpthread-compat -# pthread_setuid pthread_seteuid pthread_setreuid \ -# pthread_setresuid \ -# pthread_setgid pthread_setegid pthread_setregid \ -# pthread_setresgid libpthread-shared-only-routines = version pt-interp pt-allocrtsig \ unwind-forcedunwind diff --git a/nptl/pthread_setegid.c b/nptl/pthread_setegid.c deleted file mode 100644 index 9252dfac7d..0000000000 --- a/nptl/pthread_setegid.c +++ /dev/null @@ -1,3 +0,0 @@ -#define SINGLE_THREAD -#define setegid pthread_setegid_np -#include diff --git a/nptl/pthread_seteuid.c b/nptl/pthread_seteuid.c deleted file mode 100644 index 47bb698025..0000000000 --- a/nptl/pthread_seteuid.c +++ /dev/null @@ -1,3 +0,0 @@ -#define SINGLE_THREAD -#define seteuid pthread_seteuid_np -#include diff --git a/nptl/pthread_setgid.c b/nptl/pthread_setgid.c deleted file mode 100644 index b06bffbf32..0000000000 --- a/nptl/pthread_setgid.c +++ /dev/null @@ -1,3 +0,0 @@ -#define SINGLE_THREAD -#define __setgid pthread_setgid_np -#include diff --git a/nptl/pthread_setregid.c b/nptl/pthread_setregid.c deleted file mode 100644 index 7461d2b7fd..0000000000 --- a/nptl/pthread_setregid.c +++ /dev/null @@ -1,3 +0,0 @@ -#define SINGLE_THREAD -#define __setregid pthread_setregid_np -#include diff --git a/nptl/pthread_setresgid.c b/nptl/pthread_setresgid.c deleted file mode 100644 index 369fae2672..0000000000 --- a/nptl/pthread_setresgid.c +++ /dev/null @@ -1,3 +0,0 @@ -#define SINGLE_THREAD -#define __setresgid pthread_setresgid_np -#include diff --git a/nptl/pthread_setresuid.c b/nptl/pthread_setresuid.c deleted file mode 100644 index ac57c0fa8d..0000000000 --- a/nptl/pthread_setresuid.c +++ /dev/null @@ -1,3 +0,0 @@ -#define SINGLE_THREAD -#define __setresuid pthread_setresuid_np -#include diff --git a/nptl/pthread_setreuid.c b/nptl/pthread_setreuid.c deleted file mode 100644 index aa804ab01d..0000000000 --- a/nptl/pthread_setreuid.c +++ /dev/null @@ -1,3 +0,0 @@ -#define SINGLE_THREAD -#define __setreuid pthread_setreuid_np -#include diff --git a/nptl/pthread_setuid.c b/nptl/pthread_setuid.c deleted file mode 100644 index ff949c850f..0000000000 --- a/nptl/pthread_setuid.c +++ /dev/null @@ -1,3 +0,0 @@ -#define SINGLE_THREAD -#define __setuid pthread_setuid_np -#include From patchwork Wed Nov 18 19:55:27 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adhemerval Zanella Netto X-Patchwork-Id: 41102 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 9F2CD3942021; Wed, 18 Nov 2020 19:56:07 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 9F2CD3942021 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1605729367; bh=aIM+y8xIIq9MEsVjEFj4PlVrtoH7mvVwFNgJzmYXa7s=; h=To:Subject:Date:In-Reply-To:References:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=eYwCYMQwvKe+8BH/lnLu0TrtXtbyIaInRU4P/IDwjSDFwAwJQ9jfrakJVWUy3PlOO n1kT76zvMbbwlYq2s4BhJRxR2RCPBPb4/G4kG6u+LALKf0kvmKHMzzRK+hy4zMRw4a W4QtYVUCMQtHESlolFJHhqMEGkPhWCyxsvJeOJDo= X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from mail-qk1-x744.google.com (mail-qk1-x744.google.com [IPv6:2607:f8b0:4864:20::744]) by sourceware.org (Postfix) with ESMTPS id 64F943854800 for ; Wed, 18 Nov 2020 19:56:03 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 64F943854800 Received: by mail-qk1-x744.google.com with SMTP id q22so3082130qkq.6 for ; Wed, 18 Nov 2020 11:56:03 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=aIM+y8xIIq9MEsVjEFj4PlVrtoH7mvVwFNgJzmYXa7s=; b=rNQq7h0jAx8q7n6RgqlL/Ez7+uh8uXu5A/Ib9FUumTAz+vk0Bw/3OjnUVOAYKUm7Bn fr7yCrbP1PEzMYopw7CjT7VIMgM+IyjAEKuQxmdyu6uA76JaYNt4iRuL1hqD3Gg5mG8E uiAOfMnbBOCT9YQeMx+vNkgh3HGgmUeMoMHxDHEq7Gw/fCZxpcVgZ/T3ufx5sBI+NWpK n1VP9RLwFWkAx3M1xaOSQtxLTueFUmejGfh8A5WvrpXkJF7kwjuZzJKFw8XY4nNzyRyz iXnYMVK6ucFeI1ImqnPY8W2GrbHPB9L95TpNYyQ94UJq7O5ttADn3MYaPui72sd3GAGj qL+Q== X-Gm-Message-State: AOAM533iL7op/aHYLUuVOHfwGnb6A8nfLpVPsZDdDnYpobTIsb2+LPxG Y3YlTzgoctLcmoDHDmwVmY5msgwgxnkBEw== X-Google-Smtp-Source: ABdhPJy3HKtZS40Fg+Rfk7hI6DqAW+fTUQqZbhPJ/ybRsOEkCOQdORHUoIUCdWF4Yp7ZZHeECny1ZA== X-Received: by 2002:a05:620a:10a3:: with SMTP id h3mr6248385qkk.459.1605729362665; Wed, 18 Nov 2020 11:56:02 -0800 (PST) Received: from localhost.localdomain ([177.194.48.209]) by smtp.googlemail.com with ESMTPSA id f27sm6538775qtv.95.2020.11.18.11.56.01 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 18 Nov 2020 11:56:02 -0800 (PST) To: libc-alpha@sourceware.org Subject: [PATCH 03/28] Remove local-setxid.h Date: Wed, 18 Nov 2020 16:55:27 -0300 Message-Id: <20201118195552.2687336-4-adhemerval.zanella@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20201118195552.2687336-1-adhemerval.zanella@linaro.org> References: <20201118195552.2687336-1-adhemerval.zanella@linaro.org> MIME-Version: 1.0 X-Spam-Status: No, score=-13.9 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Adhemerval Zanella via Libc-alpha From: Adhemerval Zanella Netto Reply-To: Adhemerval Zanella Errors-To: libc-alpha-bounces@sourceware.org Sender: "Libc-alpha" The required Linux specific implementation is moved to internal posix_spawn implementation. No semantic changes expected. --- sysdeps/generic/local-setxid.h | 4 ---- sysdeps/posix/spawni.c | 5 ++--- sysdeps/unix/sysv/linux/local-setxid.h | 16 ---------------- sysdeps/unix/sysv/linux/spawni.c | 19 ++++++++++++++++++- 4 files changed, 20 insertions(+), 24 deletions(-) delete mode 100644 sysdeps/generic/local-setxid.h delete mode 100644 sysdeps/unix/sysv/linux/local-setxid.h diff --git a/sysdeps/generic/local-setxid.h b/sysdeps/generic/local-setxid.h deleted file mode 100644 index b70d9ffb32..0000000000 --- a/sysdeps/generic/local-setxid.h +++ /dev/null @@ -1,4 +0,0 @@ -/* No special support. Fall back to the regular functions. */ - -#define local_seteuid(id) seteuid (id) -#define local_setegid(id) setegid (id) diff --git a/sysdeps/posix/spawni.c b/sysdeps/posix/spawni.c index 943a598771..2dcbc1bf24 100644 --- a/sysdeps/posix/spawni.c +++ b/sysdeps/posix/spawni.c @@ -26,7 +26,6 @@ #include #include #include -#include #include #include #include @@ -139,8 +138,8 @@ __spawni_child (void *arguments) /* Set the effective user and group IDs. */ if ((attr->__flags & POSIX_SPAWN_RESETIDS) != 0 - && (local_seteuid (__getuid ()) != 0 - || local_setegid (__getgid ())) != 0) + && (__seteuid (__getuid ()) != 0 + || __setegid (__getgid ())) != 0) goto fail; /* Execute the file actions. */ diff --git a/sysdeps/unix/sysv/linux/local-setxid.h b/sysdeps/unix/sysv/linux/local-setxid.h deleted file mode 100644 index 97d787d942..0000000000 --- a/sysdeps/unix/sysv/linux/local-setxid.h +++ /dev/null @@ -1,16 +0,0 @@ -/* SETxID functions which only have to change the local thread and - none of the possible other threads. */ -#include - -#ifdef __NR_setresuid32 -# define local_seteuid(id) INLINE_SYSCALL (setresuid32, 3, -1, id, -1) -#else -# define local_seteuid(id) INLINE_SYSCALL (setresuid, 3, -1, id, -1) -#endif - - -#ifdef __NR_setresgid32 -# define local_setegid(id) INLINE_SYSCALL (setresgid32, 3, -1, id, -1) -#else -# define local_setegid(id) INLINE_SYSCALL (setresgid, 3, -1, id, -1) -#endif diff --git a/sysdeps/unix/sysv/linux/spawni.c b/sysdeps/unix/sysv/linux/spawni.c index f157bfffd2..d8623534cf 100644 --- a/sysdeps/unix/sysv/linux/spawni.c +++ b/sysdeps/unix/sysv/linux/spawni.c @@ -25,7 +25,6 @@ #include #include #include -#include #include #include #include @@ -74,6 +73,24 @@ # define STACK(__stack, __stack_size) (__stack + __stack_size) #endif +/* SETxID functions which only have to change the local thread and none of the + possible other threads. */ +static int local_seteuid (uid_t euid) +{ +#ifndef __NR_setresuid32 +# define __NR_setresuid32 __NR_setresuid +#endif + return INLINE_SYSCALL_CALL (setresuid32, -1, euid, -1); +} + +static int local_setegid (uid_t egid) +{ +#ifndef __NR_setresgid32 +# define __NR_setresgid32 __NR_setresgid +#endif + return INLINE_SYSCALL_CALL (setresgid32, -1, egid, -1); +} + struct posix_spawn_args { From patchwork Wed Nov 18 19:55:28 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adhemerval Zanella Netto X-Patchwork-Id: 41103 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 2B35B3943540; Wed, 18 Nov 2020 19:56:08 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 2B35B3943540 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1605729368; bh=nDAPBQ1MikdTDSQF6FwH5DX9Z9LahuNJUMmpFSBsgW8=; h=To:Subject:Date:In-Reply-To:References:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=bzCsaMGlgaWsZt/+u7Ie064ZOvz7kFIoK13Creik8SiJ+0Sa+P3XQaDeNiiwJq2lQ IUdUKk/ob8JtBb0HZ8C8Gq5Q18ivlW8X9gzKCx8qUA1eCRDDab07wjiMA6Rwq7x66R P7rlhnbT75sMQtaYx2utNueyF5LUbueTUw27/TWQ= X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from mail-qk1-x72c.google.com (mail-qk1-x72c.google.com [IPv6:2607:f8b0:4864:20::72c]) by sourceware.org (Postfix) with ESMTPS id A9C67393FC34 for ; Wed, 18 Nov 2020 19:56:04 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org A9C67393FC34 Received: by mail-qk1-x72c.google.com with SMTP id q5so3035696qkc.12 for ; Wed, 18 Nov 2020 11:56:04 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=nDAPBQ1MikdTDSQF6FwH5DX9Z9LahuNJUMmpFSBsgW8=; b=rEJ0WEmForW/do9+GbCGGdc8kJ+E+U42WCHs3ickzVh6CeuUQhG3/4uWg1tvfjMnVi AdDl6DmY8qxK+EAt2rPCWCKvhnWsNSoW8vMlEyxAzXWkRSXG30N1MX+Z8o8Q8sRHxeRJ jBhyUaujYnT4ZlR6uq3deOspBOsuWfNNweCeezSsPjbGrC9oxIBYe9ldVsycxE8iM/vw jipMxhN01U9uR9qJP3c4kzmxvzCqOzOIQ4qOvaj55RegsS/+x7wJ7COItZfGdER/juyI LelQDlKOupF7f7j5vXpMWaiyu1mnIYI3VJFNs+a1WuPI72s1EWg/Fzs0HDMLapgBH0Zu QNsQ== X-Gm-Message-State: AOAM532fIpV5ynCjw3JjQnDqzEU/NEhTN9x7zDmzWJ20SK1Y+f2/vVUg bPyY69GkzH0NvD484sv3JLV8/I3Ez6PJIQ== X-Google-Smtp-Source: ABdhPJxriJcoUENzvKXbrlzBnx1o7oOa+pL3dcCGyL9mo2+Zh1jhZxb1HNguQzeW5JV08XbfPjnqxQ== X-Received: by 2002:a37:a546:: with SMTP id o67mr7001214qke.167.1605729364060; Wed, 18 Nov 2020 11:56:04 -0800 (PST) Received: from localhost.localdomain ([177.194.48.209]) by smtp.googlemail.com with ESMTPSA id f27sm6538775qtv.95.2020.11.18.11.56.02 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 18 Nov 2020 11:56:03 -0800 (PST) To: libc-alpha@sourceware.org Subject: [PATCH 04/28] Remove HAVE_INLINED_SYSCALLS usage on generic implementations Date: Wed, 18 Nov 2020 16:55:28 -0300 Message-Id: <20201118195552.2687336-5-adhemerval.zanella@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20201118195552.2687336-1-adhemerval.zanella@linaro.org> References: <20201118195552.2687336-1-adhemerval.zanella@linaro.org> MIME-Version: 1.0 X-Spam-Status: No, score=-13.9 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Adhemerval Zanella via Libc-alpha From: Adhemerval Zanella Netto Reply-To: Adhemerval Zanella Errors-To: libc-alpha-bounces@sourceware.org Sender: "Libc-alpha" Checked on x86_64-linux-gnu. --- debug/read_chk.c | 9 --------- debug/readlink_chk.c | 5 ----- 2 files changed, 14 deletions(-) diff --git a/debug/read_chk.c b/debug/read_chk.c index abecb0ef23..5887c58d73 100644 --- a/debug/read_chk.c +++ b/debug/read_chk.c @@ -17,11 +17,6 @@ #include #include -#ifdef HAVE_INLINED_SYSCALLS -# include -# include -#endif - ssize_t __read_chk (int fd, void *buf, size_t nbytes, size_t buflen) @@ -29,9 +24,5 @@ __read_chk (int fd, void *buf, size_t nbytes, size_t buflen) if (nbytes > buflen) __chk_fail (); -#ifdef HAVE_INLINED_SYSCALLS - return INLINE_SYSCALL (read, 3, fd, buf, nbytes); -#else return __read (fd, buf, nbytes); -#endif } diff --git a/debug/readlink_chk.c b/debug/readlink_chk.c index 853b142b2a..ade44ee0d1 100644 --- a/debug/readlink_chk.c +++ b/debug/readlink_chk.c @@ -17,11 +17,6 @@ #include #include -#ifdef HAVE_INLINED_SYSCALLS -# include -# include -#endif - ssize_t __readlink_chk (const char *path, void *buf, size_t len, size_t buflen) From patchwork Wed Nov 18 19:55:29 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adhemerval Zanella Netto X-Patchwork-Id: 41104 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 2E8ED394443E; Wed, 18 Nov 2020 19:56:09 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 2E8ED394443E DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1605729369; bh=VE6io884apdP22jOuAK/APkmESNXKBlcl67lLgdMjR4=; h=To:Subject:Date:In-Reply-To:References:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=b/q/V4N8UVzaNDlLJINdHfdYRQwfPy68qZk0tKO8cojlwklBUBow/wmkPoOpGVfSx GtHy+o8Qaedqx21oQ8Jdh7nu3Azx7EGdtoWQSUJbyeUobAVc9b5VZtkl/Z6kvlMafa VXNf90La/UYsKQXoyvdoJRr8oHAhzAn8A0BxDFgs= X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from mail-qk1-x741.google.com (mail-qk1-x741.google.com [IPv6:2607:f8b0:4864:20::741]) by sourceware.org (Postfix) with ESMTPS id 2AF733942001 for ; Wed, 18 Nov 2020 19:56:06 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 2AF733942001 Received: by mail-qk1-x741.google.com with SMTP id l2so3127554qkf.0 for ; Wed, 18 Nov 2020 11:56:06 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=VE6io884apdP22jOuAK/APkmESNXKBlcl67lLgdMjR4=; b=bye2j7X2P5yVv86ybyElohUci10OhlfVzqAFeAPOj0ZB2Eoq9NAret6sHkOSqGMSYL oFJVyUGn5hNQOZLGe0bweYaNxxLU8+MLzLXtpcien5Fu0v++NaqwgOWu50vMktKbFWKh BkDMVrcZJjA9FqlldIqzqctRPwUMZdhgiZB2tdAHKV92Dl9Q8sJndSbgJEHrTM4zxeI4 ymTHmStUdlEXH+InkQW0G67LG0Qje9IggeIc5B04fbjYuqeuh4GfS8SJ+UT1DLz9EOJL XFGMvm1vcuPbOGGg5POtqtjZ3G1m7DE2qckzSQoRvWuaIeyBcGph1AuSt4Hcgqu9249N SkTQ== X-Gm-Message-State: AOAM533dZGAyiHVOsotszrsQaOCFxdeIv1gKe3mVHjnNLMbR2mvDdjLz Xi7EYhoB4Y6402r2ZDMm3NiFHoSywYFZVQ== X-Google-Smtp-Source: ABdhPJys+YuJfftw9qLO0lvsU4wsEDqUPqEqAYsL5shubfcB8Vsczu1FUAlYV0/PK/pIS+UNWjm3ZA== X-Received: by 2002:a05:620a:57b:: with SMTP id p27mr6495795qkp.417.1605729365407; Wed, 18 Nov 2020 11:56:05 -0800 (PST) Received: from localhost.localdomain ([177.194.48.209]) by smtp.googlemail.com with ESMTPSA id f27sm6538775qtv.95.2020.11.18.11.56.04 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 18 Nov 2020 11:56:05 -0800 (PST) To: libc-alpha@sourceware.org Subject: [PATCH 05/28] linux: Consolidate and cleanup personality syscall Date: Wed, 18 Nov 2020 16:55:29 -0300 Message-Id: <20201118195552.2687336-6-adhemerval.zanella@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20201118195552.2687336-1-adhemerval.zanella@linaro.org> References: <20201118195552.2687336-1-adhemerval.zanella@linaro.org> MIME-Version: 1.0 X-Spam-Status: No, score=-13.9 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Adhemerval Zanella via Libc-alpha From: Adhemerval Zanella Netto Reply-To: Adhemerval Zanella Errors-To: libc-alpha-bounces@sourceware.org Sender: "Libc-alpha" The PERSONALITY_TRUNCATE_ARGUMENT handling is also removed: Linux currently does not define any flag larger than unsigned int and if it is required for sparc64 (where the syscall does accept an unsigned long) it would be better to add an arch specific implementation. Checked on x86_64-linux-gnu. --- sysdeps/unix/sysv/linux/arm/syscalls.list | 2 -- sysdeps/unix/sysv/linux/hppa/syscalls.list | 1 - sysdeps/unix/sysv/linux/i386/syscalls.list | 2 -- sysdeps/unix/sysv/linux/m68k/syscalls.list | 1 - .../unix/sysv/linux/microblaze/syscalls.list | 1 - .../sysv/linux/mips/mips64/n32/syscalls.list | 2 -- sysdeps/unix/sysv/linux/personality.c | 24 +------------------ .../sysv/linux/s390/s390-32/syscalls.list | 1 - sysdeps/unix/sysv/linux/sh/syscalls.list | 2 -- .../sysv/linux/sparc/sparc64/personality.c | 3 --- .../unix/sysv/linux/wordsize-64/syscalls.list | 1 - .../unix/sysv/linux/x86_64/x32/syscalls.list | 1 - 12 files changed, 1 insertion(+), 40 deletions(-) delete mode 100644 sysdeps/unix/sysv/linux/sparc/sparc64/personality.c diff --git a/sysdeps/unix/sysv/linux/arm/syscalls.list b/sysdeps/unix/sysv/linux/arm/syscalls.list index 13441f7eb4..b19f26a2dd 100644 --- a/sysdeps/unix/sysv/linux/arm/syscalls.list +++ b/sysdeps/unix/sysv/linux/arm/syscalls.list @@ -19,8 +19,6 @@ prlimit64 EXTRA prlimit64 i:iipp prlimit64 fanotify_mark EXTRA fanotify_mark i:iiiiis fanotify_mark -personality EXTRA personality Ei:i __personality personality - # proper socket implementations: bind - bind i:ipi __bind bind getpeername - getpeername i:ipp __getpeername getpeername diff --git a/sysdeps/unix/sysv/linux/hppa/syscalls.list b/sysdeps/unix/sysv/linux/hppa/syscalls.list index cd37573b89..2a776aae27 100644 --- a/sysdeps/unix/sysv/linux/hppa/syscalls.list +++ b/sysdeps/unix/sysv/linux/hppa/syscalls.list @@ -13,4 +13,3 @@ socketpair - socketpair i:iiif __socketpair socketpair prlimit64 EXTRA prlimit64 i:iipp __prlimit64 prlimit64@@GLIBC_2.17 fanotify_mark EXTRA fanotify_mark i:iiiiis __fanotify_mark fanotify_mark@@GLIBC_2.19 -personality EXTRA personality Ei:i __personality personality diff --git a/sysdeps/unix/sysv/linux/i386/syscalls.list b/sysdeps/unix/sysv/linux/i386/syscalls.list index 58020dfae5..191081b949 100644 --- a/sysdeps/unix/sysv/linux/i386/syscalls.list +++ b/sysdeps/unix/sysv/linux/i386/syscalls.list @@ -22,5 +22,3 @@ vm86 - vm86 i:ip __vm86 vm86@@GLIBC_2.3.4 prlimit64 EXTRA prlimit64 i:iipp prlimit64 fanotify_mark EXTRA fanotify_mark i:iiiiis fanotify_mark - -personality EXTRA personality Ei:i __personality personality diff --git a/sysdeps/unix/sysv/linux/m68k/syscalls.list b/sysdeps/unix/sysv/linux/m68k/syscalls.list index 55a377b841..aba75b59e0 100644 --- a/sysdeps/unix/sysv/linux/m68k/syscalls.list +++ b/sysdeps/unix/sysv/linux/m68k/syscalls.list @@ -18,4 +18,3 @@ setfsuid - setfsuid32 Ei:i setfsuid cacheflush EXTRA cacheflush i:iiii __cacheflush cacheflush prlimit64 EXTRA prlimit64 i:iipp prlimit64 fanotify_mark EXTRA fanotify_mark i:iiiiis fanotify_mark -personality EXTRA personality Ei:i __personality personality diff --git a/sysdeps/unix/sysv/linux/microblaze/syscalls.list b/sysdeps/unix/sysv/linux/microblaze/syscalls.list index 932c9cccc8..4ff1c9da7e 100644 --- a/sysdeps/unix/sysv/linux/microblaze/syscalls.list +++ b/sysdeps/unix/sysv/linux/microblaze/syscalls.list @@ -4,4 +4,3 @@ cacheflush EXTRA cacheflush i:iiii __cacheflush cacheflush prlimit64 EXTRA prlimit64 i:iipp prlimit64 fanotify_mark EXTRA fanotify_mark i:iiiiis fanotify_mark -personality EXTRA personality Ei:i __personality personality diff --git a/sysdeps/unix/sysv/linux/mips/mips64/n32/syscalls.list b/sysdeps/unix/sysv/linux/mips/mips64/n32/syscalls.list index 9e6a584685..e6c511fecb 100644 --- a/sysdeps/unix/sysv/linux/mips/mips64/n32/syscalls.list +++ b/sysdeps/unix/sysv/linux/mips/mips64/n32/syscalls.list @@ -7,5 +7,3 @@ lseek64 - lseek i:iii __lseek64 __libc_lseek64 lseek64@@GLIBC_2.2 llseek@GLIBC prlimit64 EXTRA prlimit64 i:iipp prlimit64 fanotify_mark EXTRA fanotify_mark i:iiiis fanotify_mark - -personality EXTRA personality Ei:i __personality personality diff --git a/sysdeps/unix/sysv/linux/personality.c b/sysdeps/unix/sysv/linux/personality.c index e45fffa1c2..4ab7d0ec1d 100644 --- a/sysdeps/unix/sysv/linux/personality.c +++ b/sysdeps/unix/sysv/linux/personality.c @@ -18,31 +18,9 @@ #include #include -extern __typeof (personality) __personality; - int __personality (unsigned long persona) { -#ifdef PERSONALITY_TRUNCATE_ARGUMENT - /* Starting with kernel commit v2.6.21-3117-g97dc32c, the type of - task_struct->pesonality is "unsigned int". - Starting with kernel commit v2.6.35-rc1-372-g485d527, the personality - syscall accepts "unsigned int" instead of "long unsigned int". - Inbetween, a personality argument that does not fit into "unsigned int" - would result to system call returning -EINVAL. - We explicitly truncate the personality argument to "unsigned int" - to eliminate the uncertainty. */ - persona = (unsigned int) persona; -#endif - - long int ret = INTERNAL_SYSCALL_CALL (personality, persona); - - /* Starting with kernel commit v2.6.29-6609-g11d06b2, the personality syscall - never fails. However, 32-bit kernels might flag valid values as errors, so - we need to reverse the error setting. We can't use the raw result as some - arches split the return/error values. */ - if (__glibc_unlikely (INTERNAL_SYSCALL_ERROR_P (ret))) - ret = -INTERNAL_SYSCALL_ERRNO (ret); - return ret; + return INTERNAL_SYSCALL_CALL (personality, persona); } weak_alias (__personality, personality) diff --git a/sysdeps/unix/sysv/linux/s390/s390-32/syscalls.list b/sysdeps/unix/sysv/linux/s390/s390-32/syscalls.list index 300b13dd01..5c267744db 100644 --- a/sysdeps/unix/sysv/linux/s390/s390-32/syscalls.list +++ b/sysdeps/unix/sysv/linux/s390/s390-32/syscalls.list @@ -17,4 +17,3 @@ setfsuid - setfsuid32 Ei:i setfsuid prlimit64 EXTRA prlimit64 i:iipp prlimit64 fanotify_mark EXTRA fanotify_mark i:iiiiis fanotify_mark -personality EXTRA personality Ei:i __personality personality diff --git a/sysdeps/unix/sysv/linux/sh/syscalls.list b/sysdeps/unix/sysv/linux/sh/syscalls.list index 32badd1ee0..6c2d2c6535 100644 --- a/sysdeps/unix/sysv/linux/sh/syscalls.list +++ b/sysdeps/unix/sysv/linux/sh/syscalls.list @@ -18,5 +18,3 @@ setfsuid - setfsuid32 Ei:i setfsuid prlimit64 EXTRA prlimit64 i:iipp prlimit64 fanotify_mark EXTRA fanotify_mark i:iiiiis __fanotify_mark fanotify_mark@@GLIBC_2.16 - -personality EXTRA personality Ei:i __personality personality diff --git a/sysdeps/unix/sysv/linux/sparc/sparc64/personality.c b/sysdeps/unix/sysv/linux/sparc/sparc64/personality.c deleted file mode 100644 index 250e501d91..0000000000 --- a/sysdeps/unix/sysv/linux/sparc/sparc64/personality.c +++ /dev/null @@ -1,3 +0,0 @@ -/* Work around sign extension bug in the kernel. */ -#define PERSONALITY_TRUNCATE_ARGUMENT -#include diff --git a/sysdeps/unix/sysv/linux/wordsize-64/syscalls.list b/sysdeps/unix/sysv/linux/wordsize-64/syscalls.list index 5de6ec823a..9316778dae 100644 --- a/sysdeps/unix/sysv/linux/wordsize-64/syscalls.list +++ b/sysdeps/unix/sysv/linux/wordsize-64/syscalls.list @@ -6,4 +6,3 @@ sendfile - sendfile i:iipi sendfile sendfile64 prlimit EXTRA prlimit64 i:iipp prlimit prlimit64 fanotify_mark EXTRA fanotify_mark i:iiiis fanotify_mark -personality EXTRA personality i:i __personality personality diff --git a/sysdeps/unix/sysv/linux/x86_64/x32/syscalls.list b/sysdeps/unix/sysv/linux/x86_64/x32/syscalls.list index 58ea31d1fd..758ee988c5 100644 --- a/sysdeps/unix/sysv/linux/x86_64/x32/syscalls.list +++ b/sysdeps/unix/sysv/linux/x86_64/x32/syscalls.list @@ -1,4 +1,3 @@ # File name Caller Syscall name # args Strong name Weak names -personality EXTRA personality Ei:i __personality personality posix_fadvise64 - fadvise64 Vi:iiii posix_fadvise posix_fadvise64 From patchwork Wed Nov 18 19:55:30 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adhemerval Zanella Netto X-Patchwork-Id: 41105 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id AC4B73944427; Wed, 18 Nov 2020 19:56:09 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org AC4B73944427 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1605729369; bh=h2VIVF+za3+g3eWAO1QE8jyIaT9bCeUaGCuqFgc3/KI=; h=To:Subject:Date:In-Reply-To:References:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=bzox5Iez0bH7W3lsEnEgKl9nHqy0ogXhqvdJhoexNMajyWsiKqcRJ1GZ+lVixDnjd jvkfSo9qLNpYbFt/p0QU2M75GR+vuwEMBKxnZUeXL360ze2DT5t59M7b84ZqUZyve3 fIMgdRFXz4NTvVg57Lp/+lQ6FSgLSjm8TUK5X4FA= X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from mail-qk1-x72a.google.com (mail-qk1-x72a.google.com [IPv6:2607:f8b0:4864:20::72a]) by sourceware.org (Postfix) with ESMTPS id 49CB33940CF0 for ; Wed, 18 Nov 2020 19:56:07 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 49CB33940CF0 Received: by mail-qk1-x72a.google.com with SMTP id y197so3064955qkb.7 for ; Wed, 18 Nov 2020 11:56:07 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=h2VIVF+za3+g3eWAO1QE8jyIaT9bCeUaGCuqFgc3/KI=; b=MqPgYvDzw+82RUacZCN+FHs460Srj8egoGqMnMLGVCkP38+qfeU36Uq3l0O4gMFUZR jjcvn/0nKM+eeVtuPBhIKi2prPB1SaAubisk7Gli1Dfjz+MePybKTChvw2mnBOlS+VP/ tEtUggglS15N++yOGFDbLpQTUEY/gpBiBnnCLldTGp5dYc8jbYjtMo02FZ8f+B6sd66u gCVWweGyMEcoRgprlgy9VcMfxE9kbJLj60l7tq7ItxL6z1qT6An3k3GSXyRQQWbfVWm6 7wDr7Bw3/YY7fmYDTYzqOiyGP71kOdOJ69+nBTpz3s0gNx5bHFxrxtpRnBhP2M2xy0vE JO0Q== X-Gm-Message-State: AOAM530jZWfQiT+33sYTi3ptEW6yFtnFZmm+zltrvELXkZSgws1XRsf2 xbgrntXVHIHd75ed24ZbopsL5CWi8puTdg== X-Google-Smtp-Source: ABdhPJywqjt4WYvTB1RLFMF12ro/ZAlJnuDiEhY4nhtuFdr0mlLqNIKpNYfB+FHYgK29cDwVtTZV9g== X-Received: by 2002:a37:9f14:: with SMTP id i20mr6257715qke.137.1605729366721; Wed, 18 Nov 2020 11:56:06 -0800 (PST) Received: from localhost.localdomain ([177.194.48.209]) by smtp.googlemail.com with ESMTPSA id f27sm6538775qtv.95.2020.11.18.11.56.05 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 18 Nov 2020 11:56:06 -0800 (PST) To: libc-alpha@sourceware.org Subject: [PATCH 06/28] x32: Remove syscalls.list Date: Wed, 18 Nov 2020 16:55:30 -0300 Message-Id: <20201118195552.2687336-7-adhemerval.zanella@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20201118195552.2687336-1-adhemerval.zanella@linaro.org> References: <20201118195552.2687336-1-adhemerval.zanella@linaro.org> MIME-Version: 1.0 X-Spam-Status: No, score=-13.9 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Adhemerval Zanella via Libc-alpha From: Adhemerval Zanella Netto Reply-To: Adhemerval Zanella Errors-To: libc-alpha-bounces@sourceware.org Sender: "Libc-alpha" It is not used anyway and generic implementation already handles it. Checked on x86_64-linux-gnu-x32. --- sysdeps/unix/sysv/linux/x86_64/x32/syscalls.list | 3 --- 1 file changed, 3 deletions(-) delete mode 100644 sysdeps/unix/sysv/linux/x86_64/x32/syscalls.list diff --git a/sysdeps/unix/sysv/linux/x86_64/x32/syscalls.list b/sysdeps/unix/sysv/linux/x86_64/x32/syscalls.list deleted file mode 100644 index 758ee988c5..0000000000 --- a/sysdeps/unix/sysv/linux/x86_64/x32/syscalls.list +++ /dev/null @@ -1,3 +0,0 @@ -# File name Caller Syscall name # args Strong name Weak names - -posix_fadvise64 - fadvise64 Vi:iiii posix_fadvise posix_fadvise64 From patchwork Wed Nov 18 19:55:31 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adhemerval Zanella Netto X-Patchwork-Id: 41108 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id B4E7239450C6; Wed, 18 Nov 2020 19:56:19 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org B4E7239450C6 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1605729379; bh=NqF5zkr2jAIFT7eJm+JrrA/0sdIP1bj4FBrtyIrs99Q=; h=To:Subject:Date:In-Reply-To:References:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=HaO3eQ/tVXMFjoAAiQUQuj2MUn5HtlW3Gd8z9QeKrFRL3J548P1TTgGdoULs6gnmM deUcLcCePmaq5+xvps08qj0RmUt3LYTEeWQSN6z916fU7KVeZVLnu5rQuG//4thQqs ohhn4AqBoxOw5YwE9OJL8z+4U8a5c8HFDjyuQx2s= X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from mail-qt1-x842.google.com (mail-qt1-x842.google.com [IPv6:2607:f8b0:4864:20::842]) by sourceware.org (Postfix) with ESMTPS id D60813944430 for ; Wed, 18 Nov 2020 19:56:08 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org D60813944430 Received: by mail-qt1-x842.google.com with SMTP id f93so2560774qtb.10 for ; Wed, 18 Nov 2020 11:56:08 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=NqF5zkr2jAIFT7eJm+JrrA/0sdIP1bj4FBrtyIrs99Q=; b=gh7ZWCUGCcXGGvyWPsFGIEcJDgZLbrY0XiiJoMNFp0Q1JiTEsp4EGsRxAkyB8XB1LD AyYXI0ny14ALd0s5na4PdZVwFZ+oQKTYS4elYpMcsB9z8Rt0EZ/Ym5jVlPLme9s3Yp9L ds1lN67iYI7E9wgpT6+C42A+hZeOynTftmgKlRJa3X6UQ9iqjaEYKBBNAvdlOAHt+XcH Tq772n1uC1VArtkICSxxLHX8kPmFuBDN0jNAkjqtFSAotJSPQysrGMHRsh31INvCtPJr E4Y1hj0cJjwbIJeKoL3OfhgVyuyyrLfWZETi+TzGdZxcxN89cnekR1WcguK5HKcMqChB O+yg== X-Gm-Message-State: AOAM530MhL6CNyma7OGbnK3j44vAa2bNpX3r11VFiuIQzJ6qnsTCAdA+ Vw9MTtyHbOjeAzlIP0//L9/aIUjS3ki+6Q== X-Google-Smtp-Source: ABdhPJxZPKZXk0F6ETJoikLYOnU5MWz+LfL1Dnk4GWjbgHzfx5KznLnFYQfG1owaoo2o2N4dF7Qyew== X-Received: by 2002:ac8:4884:: with SMTP id i4mr6127784qtq.300.1605729368157; Wed, 18 Nov 2020 11:56:08 -0800 (PST) Received: from localhost.localdomain ([177.194.48.209]) by smtp.googlemail.com with ESMTPSA id f27sm6538775qtv.95.2020.11.18.11.56.07 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 18 Nov 2020 11:56:07 -0800 (PST) To: libc-alpha@sourceware.org Subject: [PATCH 07/28] linux: Assume bind support Date: Wed, 18 Nov 2020 16:55:31 -0300 Message-Id: <20201118195552.2687336-8-adhemerval.zanella@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20201118195552.2687336-1-adhemerval.zanella@linaro.org> References: <20201118195552.2687336-1-adhemerval.zanella@linaro.org> MIME-Version: 1.0 X-Spam-Status: No, score=-13.9 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Adhemerval Zanella via Libc-alpha From: Adhemerval Zanella Netto Reply-To: Adhemerval Zanella Errors-To: libc-alpha-bounces@sourceware.org Sender: "Libc-alpha" Checked with build for the affected ABI. --- sysdeps/unix/sysv/linux/alpha/syscalls.list | 1 - sysdeps/unix/sysv/linux/arm/syscalls.list | 1 - sysdeps/unix/sysv/linux/generic/syscalls.list | 1 - sysdeps/unix/sysv/linux/hppa/syscalls.list | 1 - sysdeps/unix/sysv/linux/i386/kernel-features.h | 2 +- sysdeps/unix/sysv/linux/ia64/syscalls.list | 1 - 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/mips/syscalls.list | 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 | 5 ++++- sysdeps/unix/sysv/linux/x86_64/syscalls.list | 1 - 15 files changed, 8 insertions(+), 14 deletions(-) diff --git a/sysdeps/unix/sysv/linux/alpha/syscalls.list b/sysdeps/unix/sysv/linux/alpha/syscalls.list index c7cbe886ea..a4e432c50c 100644 --- a/sysdeps/unix/sysv/linux/alpha/syscalls.list +++ b/sysdeps/unix/sysv/linux/alpha/syscalls.list @@ -5,7 +5,6 @@ sigstack - sigstack 2 sigstack getpriority - getpriority i:ii __getpriority getpriority # proper socket implementations: -bind - bind i:ipi __bind bind getpeername - getpeername i:ipp __getpeername getpeername getsockname - getsockname i:ipp __getsockname getsockname getsockopt - getsockopt i:iiiBN __getsockopt getsockopt diff --git a/sysdeps/unix/sysv/linux/arm/syscalls.list b/sysdeps/unix/sysv/linux/arm/syscalls.list index b19f26a2dd..5982889636 100644 --- a/sysdeps/unix/sysv/linux/arm/syscalls.list +++ b/sysdeps/unix/sysv/linux/arm/syscalls.list @@ -20,7 +20,6 @@ prlimit64 EXTRA prlimit64 i:iipp prlimit64 fanotify_mark EXTRA fanotify_mark i:iiiiis fanotify_mark # proper socket implementations: -bind - bind i:ipi __bind bind getpeername - getpeername i:ipp __getpeername getpeername getsockname - getsockname i:ipp __getsockname getsockname getsockopt - getsockopt i:iiiBN __getsockopt getsockopt diff --git a/sysdeps/unix/sysv/linux/generic/syscalls.list b/sysdeps/unix/sysv/linux/generic/syscalls.list index ed8b216d47..98984cf59d 100644 --- a/sysdeps/unix/sysv/linux/generic/syscalls.list +++ b/sysdeps/unix/sysv/linux/generic/syscalls.list @@ -3,7 +3,6 @@ # Socket APIs socket - socket i:iii __socket socket socketpair - socketpair i:iiif __socketpair socketpair -bind - bind i:ipi __bind bind listen - listen i:ii __listen listen getsockname - getsockname i:ipp __getsockname getsockname getpeername - getpeername i:ipp __getpeername getpeername diff --git a/sysdeps/unix/sysv/linux/hppa/syscalls.list b/sysdeps/unix/sysv/linux/hppa/syscalls.list index 2a776aae27..0f54c50eba 100644 --- a/sysdeps/unix/sysv/linux/hppa/syscalls.list +++ b/sysdeps/unix/sysv/linux/hppa/syscalls.list @@ -1,7 +1,6 @@ # File name Caller Syscall name # args Strong name Weak names # proper socket implementations: -bind - bind i:ipi __bind bind getpeername - getpeername i:ipp __getpeername getpeername getsockname - getsockname i:ipp __getsockname getsockname getsockopt - getsockopt i:iiiBN __getsockopt getsockopt diff --git a/sysdeps/unix/sysv/linux/i386/kernel-features.h b/sysdeps/unix/sysv/linux/i386/kernel-features.h index 64202a1e84..46c5334385 100644 --- a/sysdeps/unix/sysv/linux/i386/kernel-features.h +++ b/sysdeps/unix/sysv/linux/i386/kernel-features.h @@ -21,7 +21,6 @@ #if __LINUX_KERNEL_VERSION >= 0x040300 # define __ASSUME_SOCKET_SYSCALL 1 # define __ASSUME_SOCKETPAIR_SYSCALL 1 -# define __ASSUME_BIND_SYSCALL 1 # define __ASSUME_LISTEN_SYSCALL 1 # define __ASSUME_GETSOCKOPT_SYSCALL 1 # define __ASSUME_SETSOCKOPT_SYSCALL 1 @@ -35,6 +34,7 @@ #undef __ASSUME_ACCEPT_SYSCALL #if __LINUX_KERNEL_VERSION < 0x040300 +# undef __ASSUME_BIND_SYSCALL # undef __ASSUME_ACCEPT4_SYSCALL # undef __ASSUME_SENDMSG_SYSCALL # undef __ASSUME_RECVMSG_SYSCALL diff --git a/sysdeps/unix/sysv/linux/ia64/syscalls.list b/sysdeps/unix/sysv/linux/ia64/syscalls.list index bd39441d3c..5a77f18ada 100644 --- a/sysdeps/unix/sysv/linux/ia64/syscalls.list +++ b/sysdeps/unix/sysv/linux/ia64/syscalls.list @@ -3,7 +3,6 @@ getpriority - getpriority i:ii __getpriority getpriority # proper socket implementations: -bind - bind i:ipi __bind bind getpeername - getpeername i:ipp __getpeername getpeername getsockname - getsockname i:ipp __getsockname getsockname getsockopt - getsockopt i:iiiBN __getsockopt getsockopt diff --git a/sysdeps/unix/sysv/linux/kernel-features.h b/sysdeps/unix/sysv/linux/kernel-features.h index e648eecc0d..71a2631fc0 100644 --- a/sysdeps/unix/sysv/linux/kernel-features.h +++ b/sysdeps/unix/sysv/linux/kernel-features.h @@ -68,6 +68,7 @@ /* On most architectures, most socket syscalls are supported for all supported kernel versions, but on some socketcall architectures separate syscalls were only added later. */ +#define __ASSUME_BIND_SYSCALL 1 #define __ASSUME_SENDMSG_SYSCALL 1 #define __ASSUME_RECVMSG_SYSCALL 1 #define __ASSUME_ACCEPT_SYSCALL 1 diff --git a/sysdeps/unix/sysv/linux/m68k/kernel-features.h b/sysdeps/unix/sysv/linux/m68k/kernel-features.h index 4cdaf93e6d..06457d3761 100644 --- a/sysdeps/unix/sysv/linux/m68k/kernel-features.h +++ b/sysdeps/unix/sysv/linux/m68k/kernel-features.h @@ -21,7 +21,6 @@ #if __LINUX_KERNEL_VERSION >= 0x040300 # define __ASSUME_SOCKET_SYSCALL 1 # define __ASSUME_SOCKETPAIR_SYSCALL 1 -# define __ASSUME_BIND_SYSCALL 1 # define __ASSUME_LISTEN_SYSCALL 1 # define __ASSUME_GETSOCKOPT_SYSCALL 1 # define __ASSUME_SETSOCKOPT_SYSCALL 1 @@ -35,6 +34,7 @@ #undef __ASSUME_ACCEPT_SYSCALL #if __LINUX_KERNEL_VERSION < 0x040300 +# undef __ASSUME_BIND_SYSCALL # undef __ASSUME_ACCEPT4_SYSCALL # undef __ASSUME_RECVMMSG_SYSCALL # undef __ASSUME_SENDMMSG_SYSCALL diff --git a/sysdeps/unix/sysv/linux/microblaze/kernel-features.h b/sysdeps/unix/sysv/linux/microblaze/kernel-features.h index def8408014..2facec8c4c 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_SOCKET_SYSCALL 1 -#define __ASSUME_BIND_SYSCALL 1 #define __ASSUME_CONNECT_SYSCALL 1 #define __ASSUME_LISTEN_SYSCALL 1 #define __ASSUME_GETSOCKNAME_SYSCALL 1 diff --git a/sysdeps/unix/sysv/linux/mips/syscalls.list b/sysdeps/unix/sysv/linux/mips/syscalls.list index f3621cdd51..0415d40ee8 100644 --- a/sysdeps/unix/sysv/linux/mips/syscalls.list +++ b/sysdeps/unix/sysv/linux/mips/syscalls.list @@ -12,7 +12,6 @@ sysmips - sysmips i:iiii __sysmips sysmips # Socket functions; Linux/MIPS doesn't use the socketcall(2) wrapper; # it's provided for compatibility, though. # -bind - bind i:ipi __bind bind getpeername - getpeername i:ipp __getpeername getpeername getsockname - getsockname i:ipp __getsockname getsockname getsockopt - getsockopt i:iiiBN __getsockopt getsockopt diff --git a/sysdeps/unix/sysv/linux/powerpc/kernel-features.h b/sysdeps/unix/sysv/linux/powerpc/kernel-features.h index a18a2ee97f..c7079a4507 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_SOCKET_SYSCALL 1 -#define __ASSUME_BIND_SYSCALL 1 #define __ASSUME_CONNECT_SYSCALL 1 #define __ASSUME_LISTEN_SYSCALL 1 #define __ASSUME_GETSOCKNAME_SYSCALL 1 diff --git a/sysdeps/unix/sysv/linux/s390/kernel-features.h b/sysdeps/unix/sysv/linux/s390/kernel-features.h index 831d0ab7d5..549ecc994d 100644 --- a/sysdeps/unix/sysv/linux/s390/kernel-features.h +++ b/sysdeps/unix/sysv/linux/s390/kernel-features.h @@ -21,7 +21,6 @@ #if __LINUX_KERNEL_VERSION >= 0x040300 # define __ASSUME_SOCKET_SYSCALL 1 # define __ASSUME_SOCKETPAIR_SYSCALL 1 -# define __ASSUME_BIND_SYSCALL 1 # define __ASSUME_LISTEN_SYSCALL 1 # define __ASSUME_GETSOCKOPT_SYSCALL 1 # define __ASSUME_SETSOCKOPT_SYSCALL 1 @@ -35,6 +34,7 @@ #undef __ASSUME_ACCEPT_SYSCALL #if __LINUX_KERNEL_VERSION < 0x040300 +# undef __ASSUME_BIND_SYSCALL # undef __ASSUME_ACCEPT4_SYSCALL # undef __ASSUME_RECVMMSG_SYSCALL # undef __ASSUME_SENDMMSG_SYSCALL diff --git a/sysdeps/unix/sysv/linux/sh/kernel-features.h b/sysdeps/unix/sysv/linux/sh/kernel-features.h index 5bac608a11..04ecd02ecd 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_SOCKET_SYSCALL 1 -#define __ASSUME_BIND_SYSCALL 1 #define __ASSUME_CONNECT_SYSCALL 1 #define __ASSUME_LISTEN_SYSCALL 1 #define __ASSUME_GETSOCKNAME_SYSCALL 1 diff --git a/sysdeps/unix/sysv/linux/sparc/kernel-features.h b/sysdeps/unix/sysv/linux/sparc/kernel-features.h index ea642120e9..8f7348d9ad 100644 --- a/sysdeps/unix/sysv/linux/sparc/kernel-features.h +++ b/sysdeps/unix/sysv/linux/sparc/kernel-features.h @@ -45,9 +45,12 @@ # define __ASSUME_SHUTDOWN_SYSCALL 1 #endif +#if __LINUX_KERNEL_VERSION < 0x040400 +# undef __ASSUME_BIND_SYSCALL +#endif + /* These syscalls were added for both 32-bit and 64-bit in 4.4. */ #if __LINUX_KERNEL_VERSION >= 0x040400 -# define __ASSUME_BIND_SYSCALL 1 # define __ASSUME_LISTEN_SYSCALL 1 # define __ASSUME_SETSOCKOPT_SYSCALL 1 #endif diff --git a/sysdeps/unix/sysv/linux/x86_64/syscalls.list b/sysdeps/unix/sysv/linux/x86_64/syscalls.list index d46524eff3..a6a725e198 100644 --- a/sysdeps/unix/sysv/linux/x86_64/syscalls.list +++ b/sysdeps/unix/sysv/linux/x86_64/syscalls.list @@ -6,7 +6,6 @@ syscall_clock_gettime EXTRA clock_gettime Ei:ip __syscall_clock_gettime # proper socket implementations: -bind - bind i:ipi __bind bind getpeername - getpeername i:ipp __getpeername getpeername getsockname - getsockname i:ipp __getsockname getsockname getsockopt - getsockopt i:iiiBN __getsockopt getsockopt From patchwork Wed Nov 18 19:55:32 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adhemerval Zanella Netto X-Patchwork-Id: 41106 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 998543945049; Wed, 18 Nov 2020 19:56:13 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 998543945049 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1605729373; bh=EQ4qBFqUKQn3gumPpreujXMtp1YGrwwG5mCHCWWtcLk=; h=To:Subject:Date:In-Reply-To:References:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=yWSPk0LRH/tg/brAF1w6YTEejRzh8T1MTmGM42GW8LkxtMgfn0rizmOvOE5Ccy3Hz dzlpI50v5YlatEd5t1gNSRZxp4nJspa79PIVAA9j3v198jSfHcujBe4lG8EMxrAfJa 2YT4feKre2hEew22QI/QcIczfK8tq8BbWrUPDW/s= X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from mail-qt1-x841.google.com (mail-qt1-x841.google.com [IPv6:2607:f8b0:4864:20::841]) by sourceware.org (Postfix) with ESMTPS id 3CC58394504E for ; Wed, 18 Nov 2020 19:56:10 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 3CC58394504E Received: by mail-qt1-x841.google.com with SMTP id v11so2550145qtq.12 for ; Wed, 18 Nov 2020 11:56:10 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=EQ4qBFqUKQn3gumPpreujXMtp1YGrwwG5mCHCWWtcLk=; b=IY/hh4KAMmge1+ejvcFLR2/xJwUtJr3qRRBQyoKvp7kRGH7zk57pkhL4Sfqx/PQXgX vSh9DQ3hF78JLhMQhB7VHVN96hnN/VcpWkp8E5bZY06IYAX8RxkoaQyBS2Js+Jj+3z4H 2a1gSnjsC6R1JRz8xbhqUQyLhGyqs8KoB7a7ftgHFxBAg822MpmngEJgVpGDXijI07YM Li8q6s5YoWS+mNQ/7OYy+gKUCWyZCW+VbfWQE+UW2jYMfmpgyWTY33bbHyEYHwmn4TlI GHKx84dGncboBjOnWMqk53ol24srqY3qbNVQTjme8sy9zp1gblv339Y+xfATDv7IVLhu bPTQ== X-Gm-Message-State: AOAM5327/SOytqxEpC8W+h/Esy6q/OYmHpvtIriDifOIjwfO7Ip4K1P5 4zAcgRaiHiD+GNee5PxSYVMN5BBdJuPnsg== X-Google-Smtp-Source: ABdhPJyYu1SuHtlI8IiReYIhqjVhXgf818MbQxGHpXnXXPk5Qyqcmp5IDy1I53qYEDXVpiojciMSpw== X-Received: by 2002:ac8:3797:: with SMTP id d23mr5910473qtc.205.1605729369500; Wed, 18 Nov 2020 11:56:09 -0800 (PST) Received: from localhost.localdomain ([177.194.48.209]) by smtp.googlemail.com with ESMTPSA id f27sm6538775qtv.95.2020.11.18.11.56.08 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 18 Nov 2020 11:56:09 -0800 (PST) To: libc-alpha@sourceware.org Subject: [PATCH 08/28] linux: Assume getpeername support Date: Wed, 18 Nov 2020 16:55:32 -0300 Message-Id: <20201118195552.2687336-9-adhemerval.zanella@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20201118195552.2687336-1-adhemerval.zanella@linaro.org> References: <20201118195552.2687336-1-adhemerval.zanella@linaro.org> MIME-Version: 1.0 X-Spam-Status: No, score=-13.9 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Adhemerval Zanella via Libc-alpha From: Adhemerval Zanella Netto Reply-To: Adhemerval Zanella Errors-To: libc-alpha-bounces@sourceware.org Sender: "Libc-alpha" Checked with build for the affected ABI. --- sysdeps/unix/syscalls.list | 1 - sysdeps/unix/sysv/linux/alpha/syscalls.list | 1 - sysdeps/unix/sysv/linux/arm/syscalls.list | 1 - sysdeps/unix/sysv/linux/generic/syscalls.list | 1 - sysdeps/unix/sysv/linux/hppa/syscalls.list | 1 - sysdeps/unix/sysv/linux/i386/kernel-features.h | 2 +- sysdeps/unix/sysv/linux/ia64/syscalls.list | 1 - 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/mips/syscalls.list | 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/sparc64/syscalls.list | 1 - sysdeps/unix/sysv/linux/x86_64/syscalls.list | 1 - 16 files changed, 4 insertions(+), 15 deletions(-) diff --git a/sysdeps/unix/syscalls.list b/sysdeps/unix/syscalls.list index 7209c24110..6d1a2ad441 100644 --- a/sysdeps/unix/syscalls.list +++ b/sysdeps/unix/syscalls.list @@ -25,7 +25,6 @@ getgid - getgid Ei: __getgid getgid getgroups - getgroups i:ip __getgroups getgroups gethostid - gethostid i: gethostid gethostname - gethostname i:bn __gethostname gethostname -getpeername - getpeername i:ibN __getpeername getpeername getpid - getpid Ei: __getpid getpid getpriority - getpriority i:ii __getpriority getpriority getrlimit - getrlimit i:ip __getrlimit getrlimit diff --git a/sysdeps/unix/sysv/linux/alpha/syscalls.list b/sysdeps/unix/sysv/linux/alpha/syscalls.list index a4e432c50c..62d79edd56 100644 --- a/sysdeps/unix/sysv/linux/alpha/syscalls.list +++ b/sysdeps/unix/sysv/linux/alpha/syscalls.list @@ -5,7 +5,6 @@ sigstack - sigstack 2 sigstack getpriority - getpriority i:ii __getpriority getpriority # proper socket implementations: -getpeername - getpeername i:ipp __getpeername getpeername getsockname - getsockname i:ipp __getsockname getsockname getsockopt - getsockopt i:iiiBN __getsockopt getsockopt listen - listen i:ii __listen listen diff --git a/sysdeps/unix/sysv/linux/arm/syscalls.list b/sysdeps/unix/sysv/linux/arm/syscalls.list index 5982889636..87e6c6c88d 100644 --- a/sysdeps/unix/sysv/linux/arm/syscalls.list +++ b/sysdeps/unix/sysv/linux/arm/syscalls.list @@ -20,7 +20,6 @@ prlimit64 EXTRA prlimit64 i:iipp prlimit64 fanotify_mark EXTRA fanotify_mark i:iiiiis fanotify_mark # proper socket implementations: -getpeername - getpeername i:ipp __getpeername getpeername getsockname - getsockname i:ipp __getsockname getsockname getsockopt - getsockopt i:iiiBN __getsockopt getsockopt listen - listen i:ii __listen listen diff --git a/sysdeps/unix/sysv/linux/generic/syscalls.list b/sysdeps/unix/sysv/linux/generic/syscalls.list index 98984cf59d..3af1893c80 100644 --- a/sysdeps/unix/sysv/linux/generic/syscalls.list +++ b/sysdeps/unix/sysv/linux/generic/syscalls.list @@ -5,7 +5,6 @@ socket - socket i:iii __socket socket socketpair - socketpair i:iiif __socketpair socketpair listen - listen i:ii __listen listen getsockname - getsockname i:ipp __getsockname getsockname -getpeername - getpeername i:ipp __getpeername getpeername setsockopt - setsockopt i:iiibn __setsockopt setsockopt getsockopt - getsockopt i:iiiBN __getsockopt getsockopt shutdown - shutdown i:ii __shutdown shutdown diff --git a/sysdeps/unix/sysv/linux/hppa/syscalls.list b/sysdeps/unix/sysv/linux/hppa/syscalls.list index 0f54c50eba..0d4e9d5e1c 100644 --- a/sysdeps/unix/sysv/linux/hppa/syscalls.list +++ b/sysdeps/unix/sysv/linux/hppa/syscalls.list @@ -1,7 +1,6 @@ # File name Caller Syscall name # args Strong name Weak names # proper socket implementations: -getpeername - getpeername i:ipp __getpeername getpeername getsockname - getsockname i:ipp __getsockname getsockname getsockopt - getsockopt i:iiiBN __getsockopt getsockopt listen - listen i:ii __listen listen diff --git a/sysdeps/unix/sysv/linux/i386/kernel-features.h b/sysdeps/unix/sysv/linux/i386/kernel-features.h index 46c5334385..53e9890819 100644 --- a/sysdeps/unix/sysv/linux/i386/kernel-features.h +++ b/sysdeps/unix/sysv/linux/i386/kernel-features.h @@ -25,7 +25,6 @@ # define __ASSUME_GETSOCKOPT_SYSCALL 1 # define __ASSUME_SETSOCKOPT_SYSCALL 1 # define __ASSUME_GETSOCKNAME_SYSCALL 1 -# define __ASSUME_GETPEERNAME_SYSCALL 1 # define __ASSUME_SHUTDOWN_SYSCALL 1 #endif @@ -41,6 +40,7 @@ # undef __ASSUME_CONNECT_SYSCALL # undef __ASSUME_RECVFROM_SYSCALL # undef __ASSUME_SENDTO_SYSCALL +# undef __ASSUME_GETPEERNAME_SYSCALL #endif /* i686 only supports ipc syscall before 5.1. */ diff --git a/sysdeps/unix/sysv/linux/ia64/syscalls.list b/sysdeps/unix/sysv/linux/ia64/syscalls.list index 5a77f18ada..5bb62003d0 100644 --- a/sysdeps/unix/sysv/linux/ia64/syscalls.list +++ b/sysdeps/unix/sysv/linux/ia64/syscalls.list @@ -3,7 +3,6 @@ getpriority - getpriority i:ii __getpriority getpriority # proper socket implementations: -getpeername - getpeername i:ipp __getpeername getpeername getsockname - getsockname i:ipp __getsockname getsockname getsockopt - getsockopt i:iiiBN __getsockopt getsockopt listen - listen i:ii __listen listen diff --git a/sysdeps/unix/sysv/linux/kernel-features.h b/sysdeps/unix/sysv/linux/kernel-features.h index 71a2631fc0..9945f4388b 100644 --- a/sysdeps/unix/sysv/linux/kernel-features.h +++ b/sysdeps/unix/sysv/linux/kernel-features.h @@ -78,6 +78,7 @@ #define __ASSUME_ACCEPT4_SYSCALL 1 #define __ASSUME_RECVMMSG_SYSCALL 1 #define __ASSUME_SENDMMSG_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 06457d3761..e321895ae8 100644 --- a/sysdeps/unix/sysv/linux/m68k/kernel-features.h +++ b/sysdeps/unix/sysv/linux/m68k/kernel-features.h @@ -25,7 +25,6 @@ # define __ASSUME_GETSOCKOPT_SYSCALL 1 # define __ASSUME_SETSOCKOPT_SYSCALL 1 # define __ASSUME_GETSOCKNAME_SYSCALL 1 -# define __ASSUME_GETPEERNAME_SYSCALL 1 # define __ASSUME_SHUTDOWN_SYSCALL 1 #endif @@ -43,6 +42,7 @@ # undef __ASSUME_CONNECT_SYSCALL # undef __ASSUME_RECVFROM_SYSCALL # undef __ASSUME_SENDTO_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 2facec8c4c..13eba077d6 100644 --- a/sysdeps/unix/sysv/linux/microblaze/kernel-features.h +++ b/sysdeps/unix/sysv/linux/microblaze/kernel-features.h @@ -22,7 +22,6 @@ #define __ASSUME_CONNECT_SYSCALL 1 #define __ASSUME_LISTEN_SYSCALL 1 #define __ASSUME_GETSOCKNAME_SYSCALL 1 -#define __ASSUME_GETPEERNAME_SYSCALL 1 #define __ASSUME_SOCKETPAIR_SYSCALL 1 #define __ASSUME_SEND_SYSCALL 1 #define __ASSUME_RECV_SYSCALL 1 diff --git a/sysdeps/unix/sysv/linux/mips/syscalls.list b/sysdeps/unix/sysv/linux/mips/syscalls.list index 0415d40ee8..a9dff10271 100644 --- a/sysdeps/unix/sysv/linux/mips/syscalls.list +++ b/sysdeps/unix/sysv/linux/mips/syscalls.list @@ -12,7 +12,6 @@ sysmips - sysmips i:iiii __sysmips sysmips # Socket functions; Linux/MIPS doesn't use the socketcall(2) wrapper; # it's provided for compatibility, though. # -getpeername - getpeername i:ipp __getpeername getpeername getsockname - getsockname i:ipp __getsockname getsockname getsockopt - getsockopt i:iiiBN __getsockopt getsockopt listen - listen i:ii __listen listen diff --git a/sysdeps/unix/sysv/linux/powerpc/kernel-features.h b/sysdeps/unix/sysv/linux/powerpc/kernel-features.h index c7079a4507..ed7d75e0a4 100644 --- a/sysdeps/unix/sysv/linux/powerpc/kernel-features.h +++ b/sysdeps/unix/sysv/linux/powerpc/kernel-features.h @@ -22,7 +22,6 @@ #define __ASSUME_CONNECT_SYSCALL 1 #define __ASSUME_LISTEN_SYSCALL 1 #define __ASSUME_GETSOCKNAME_SYSCALL 1 -#define __ASSUME_GETPEERNAME_SYSCALL 1 #define __ASSUME_SOCKETPAIR_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 549ecc994d..7a7b22ed01 100644 --- a/sysdeps/unix/sysv/linux/s390/kernel-features.h +++ b/sysdeps/unix/sysv/linux/s390/kernel-features.h @@ -25,7 +25,6 @@ # define __ASSUME_GETSOCKOPT_SYSCALL 1 # define __ASSUME_SETSOCKOPT_SYSCALL 1 # define __ASSUME_GETSOCKNAME_SYSCALL 1 -# define __ASSUME_GETPEERNAME_SYSCALL 1 # define __ASSUME_SHUTDOWN_SYSCALL 1 #endif @@ -43,6 +42,7 @@ # undef __ASSUME_CONNECT_SYSCALL # undef __ASSUME_RECVFROM_SYSCALL # undef __ASSUME_SENDTO_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 04ecd02ecd..34109ae859 100644 --- a/sysdeps/unix/sysv/linux/sh/kernel-features.h +++ b/sysdeps/unix/sysv/linux/sh/kernel-features.h @@ -27,7 +27,6 @@ #define __ASSUME_CONNECT_SYSCALL 1 #define __ASSUME_LISTEN_SYSCALL 1 #define __ASSUME_GETSOCKNAME_SYSCALL 1 -#define __ASSUME_GETPEERNAME_SYSCALL 1 #define __ASSUME_SOCKETPAIR_SYSCALL 1 #define __ASSUME_SEND_SYSCALL 1 #define __ASSUME_RECV_SYSCALL 1 diff --git a/sysdeps/unix/sysv/linux/sparc/sparc64/syscalls.list b/sysdeps/unix/sysv/linux/sparc/sparc64/syscalls.list index d30d7f2b96..2acc8a1437 100644 --- a/sysdeps/unix/sysv/linux/sparc/sparc64/syscalls.list +++ b/sysdeps/unix/sysv/linux/sparc/sparc64/syscalls.list @@ -1,6 +1,5 @@ # File name Caller Syscall name # args Strong name Weak names -getpeername - getpeername 3 __getpeername getpeername getsockname - getsockname 3 __getsockname getsockname getsockopt - getsockopt 5 __getsockopt getsockopt shutdown - shutdown 2 __shutdown shutdown diff --git a/sysdeps/unix/sysv/linux/x86_64/syscalls.list b/sysdeps/unix/sysv/linux/x86_64/syscalls.list index a6a725e198..f7612e6545 100644 --- a/sysdeps/unix/sysv/linux/x86_64/syscalls.list +++ b/sysdeps/unix/sysv/linux/x86_64/syscalls.list @@ -6,7 +6,6 @@ syscall_clock_gettime EXTRA clock_gettime Ei:ip __syscall_clock_gettime # proper socket implementations: -getpeername - getpeername i:ipp __getpeername getpeername getsockname - getsockname i:ipp __getsockname getsockname getsockopt - getsockopt i:iiiBN __getsockopt getsockopt listen - listen i:ii __listen listen From patchwork Wed Nov 18 19:55:33 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adhemerval Zanella Netto X-Patchwork-Id: 41107 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 922C73945062; Wed, 18 Nov 2020 19:56:15 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 922C73945062 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1605729375; bh=Ww8yFM0oaKf/kKel5+jMcTEYWApOiGtaWuoktUzdpaY=; h=To:Subject:Date:In-Reply-To:References:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=ke+IktThWzDfMRz/O6OMKRYet8vGp69Ih+5rKTap4dfD+6VToxEMMKXI9ri//NPl0 6ykWOFf3OynQXYZa1WDPsiqitA7tuwDonlQl3XbY5qqV3JAA2Ai1SRpFdHN7wwqG8l bzBxJpKA+9zjO0oIE+hSdcwe9jAg58SwsN6SLGiQ= X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from mail-qk1-x743.google.com (mail-qk1-x743.google.com [IPv6:2607:f8b0:4864:20::743]) by sourceware.org (Postfix) with ESMTPS id D464D393C87C for ; Wed, 18 Nov 2020 19:56:11 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org D464D393C87C Received: by mail-qk1-x743.google.com with SMTP id v143so3105652qkb.2 for ; Wed, 18 Nov 2020 11:56:11 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=Ww8yFM0oaKf/kKel5+jMcTEYWApOiGtaWuoktUzdpaY=; b=dc+EFJ11YaQoPYh62JoUMg8NlAq3KXbUp+QlO1wfe4Kd6Nw6CoPSImTSiIgdnHSV5S Q3tjlp6ejKDjynyD2IGaDjFGq6YLzg1SXYBogg2XvLoc+wb+tqq8R/RPs+Ig9tHetGxL qYk5pgsfws3aDMoOag/IWATrZj/jIHRVmK/OkqF0FzIlBe5CkS0rujklPcHfLJWzrfvv 8uORxuxKJFD8W/C++c8HRUKIUXaoEZ6UtJcdoyUTfq5BDmJTGUC8NhSROTKe/j81x7+q KORMHJuMDkBylSGM6Ra1H/DBvXd/FFMhK03ZiXII/nVg5V9/W49FRFOcpVLTUun2sxxQ hNng== X-Gm-Message-State: AOAM533Qvow7nwfzSxGCe/GqrCa/VwJLeSp6AQfimPD7Kk66e256XuR6 cppWko06szqxs1Y1BFrMyYpnxDli98Li0g== X-Google-Smtp-Source: ABdhPJwmUOmRGRBTGjfjjrwh80Q9TDqA3mndSAyAWf5An0z4EO3dI03xP6pAmt0i33PrKUiDmouhNQ== X-Received: by 2002:a05:620a:d41:: with SMTP id o1mr6490729qkl.338.1605729370866; Wed, 18 Nov 2020 11:56:10 -0800 (PST) Received: from localhost.localdomain ([177.194.48.209]) by smtp.googlemail.com with ESMTPSA id f27sm6538775qtv.95.2020.11.18.11.56.09 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 18 Nov 2020 11:56:10 -0800 (PST) To: libc-alpha@sourceware.org Subject: [PATCH 09/28] linux: Assume getsockname support Date: Wed, 18 Nov 2020 16:55:33 -0300 Message-Id: <20201118195552.2687336-10-adhemerval.zanella@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20201118195552.2687336-1-adhemerval.zanella@linaro.org> References: <20201118195552.2687336-1-adhemerval.zanella@linaro.org> MIME-Version: 1.0 X-Spam-Status: No, score=-13.9 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Adhemerval Zanella via Libc-alpha From: Adhemerval Zanella Netto Reply-To: Adhemerval Zanella Errors-To: libc-alpha-bounces@sourceware.org Sender: "Libc-alpha" Checked with build for the affected ABI. --- sysdeps/unix/sysv/linux/alpha/syscalls.list | 1 - sysdeps/unix/sysv/linux/arm/syscalls.list | 1 - sysdeps/unix/sysv/linux/generic/syscalls.list | 1 - sysdeps/unix/sysv/linux/hppa/syscalls.list | 1 - sysdeps/unix/sysv/linux/i386/kernel-features.h | 2 +- sysdeps/unix/sysv/linux/ia64/syscalls.list | 1 - 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/mips/syscalls.list | 1 - sysdeps/unix/sysv/linux/powerpc/kernel-features.h | 1 - sysdeps/unix/sysv/linux/s390/kernel-features.h | 1 - sysdeps/unix/sysv/linux/sh/kernel-features.h | 1 - sysdeps/unix/sysv/linux/sparc/sparc64/syscalls.list | 1 - sysdeps/unix/sysv/linux/x86_64/syscalls.list | 1 - 15 files changed, 3 insertions(+), 14 deletions(-) diff --git a/sysdeps/unix/sysv/linux/alpha/syscalls.list b/sysdeps/unix/sysv/linux/alpha/syscalls.list index 62d79edd56..26e4070686 100644 --- a/sysdeps/unix/sysv/linux/alpha/syscalls.list +++ b/sysdeps/unix/sysv/linux/alpha/syscalls.list @@ -5,7 +5,6 @@ sigstack - sigstack 2 sigstack getpriority - getpriority i:ii __getpriority getpriority # proper socket implementations: -getsockname - getsockname i:ipp __getsockname getsockname getsockopt - getsockopt i:iiiBN __getsockopt getsockopt listen - listen i:ii __listen listen setsockopt - setsockopt i:iiibn __setsockopt setsockopt diff --git a/sysdeps/unix/sysv/linux/arm/syscalls.list b/sysdeps/unix/sysv/linux/arm/syscalls.list index 87e6c6c88d..71e2b99cf5 100644 --- a/sysdeps/unix/sysv/linux/arm/syscalls.list +++ b/sysdeps/unix/sysv/linux/arm/syscalls.list @@ -20,7 +20,6 @@ prlimit64 EXTRA prlimit64 i:iipp prlimit64 fanotify_mark EXTRA fanotify_mark i:iiiiis fanotify_mark # proper socket implementations: -getsockname - getsockname i:ipp __getsockname getsockname getsockopt - getsockopt i:iiiBN __getsockopt getsockopt listen - listen i:ii __listen listen setsockopt - setsockopt i:iiibn __setsockopt setsockopt diff --git a/sysdeps/unix/sysv/linux/generic/syscalls.list b/sysdeps/unix/sysv/linux/generic/syscalls.list index 3af1893c80..5e4b8f2e29 100644 --- a/sysdeps/unix/sysv/linux/generic/syscalls.list +++ b/sysdeps/unix/sysv/linux/generic/syscalls.list @@ -4,7 +4,6 @@ socket - socket i:iii __socket socket socketpair - socketpair i:iiif __socketpair socketpair listen - listen i:ii __listen listen -getsockname - getsockname i:ipp __getsockname getsockname setsockopt - setsockopt i:iiibn __setsockopt setsockopt getsockopt - getsockopt i:iiiBN __getsockopt getsockopt shutdown - shutdown i:ii __shutdown shutdown diff --git a/sysdeps/unix/sysv/linux/hppa/syscalls.list b/sysdeps/unix/sysv/linux/hppa/syscalls.list index 0d4e9d5e1c..ec6105c655 100644 --- a/sysdeps/unix/sysv/linux/hppa/syscalls.list +++ b/sysdeps/unix/sysv/linux/hppa/syscalls.list @@ -1,7 +1,6 @@ # File name Caller Syscall name # args Strong name Weak names # proper socket implementations: -getsockname - getsockname i:ipp __getsockname getsockname getsockopt - getsockopt i:iiiBN __getsockopt getsockopt listen - listen i:ii __listen listen setsockopt - setsockopt i:iiibn __setsockopt setsockopt diff --git a/sysdeps/unix/sysv/linux/i386/kernel-features.h b/sysdeps/unix/sysv/linux/i386/kernel-features.h index 53e9890819..be1cfe94b8 100644 --- a/sysdeps/unix/sysv/linux/i386/kernel-features.h +++ b/sysdeps/unix/sysv/linux/i386/kernel-features.h @@ -24,7 +24,6 @@ # define __ASSUME_LISTEN_SYSCALL 1 # define __ASSUME_GETSOCKOPT_SYSCALL 1 # define __ASSUME_SETSOCKOPT_SYSCALL 1 -# define __ASSUME_GETSOCKNAME_SYSCALL 1 # define __ASSUME_SHUTDOWN_SYSCALL 1 #endif @@ -41,6 +40,7 @@ # undef __ASSUME_RECVFROM_SYSCALL # undef __ASSUME_SENDTO_SYSCALL # undef __ASSUME_GETPEERNAME_SYSCALL +# undef __ASSUME_GETSOCKNAME_SYSCALL #endif /* i686 only supports ipc syscall before 5.1. */ diff --git a/sysdeps/unix/sysv/linux/ia64/syscalls.list b/sysdeps/unix/sysv/linux/ia64/syscalls.list index 5bb62003d0..748ba3215c 100644 --- a/sysdeps/unix/sysv/linux/ia64/syscalls.list +++ b/sysdeps/unix/sysv/linux/ia64/syscalls.list @@ -3,7 +3,6 @@ getpriority - getpriority i:ii __getpriority getpriority # proper socket implementations: -getsockname - getsockname i:ipp __getsockname getsockname getsockopt - getsockopt i:iiiBN __getsockopt getsockopt listen - listen i:ii __listen listen setsockopt - setsockopt i:iiibn __setsockopt setsockopt diff --git a/sysdeps/unix/sysv/linux/kernel-features.h b/sysdeps/unix/sysv/linux/kernel-features.h index 9945f4388b..7266f34100 100644 --- a/sysdeps/unix/sysv/linux/kernel-features.h +++ b/sysdeps/unix/sysv/linux/kernel-features.h @@ -79,6 +79,7 @@ #define __ASSUME_RECVMMSG_SYSCALL 1 #define __ASSUME_SENDMMSG_SYSCALL 1 #define __ASSUME_GETPEERNAME_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 e321895ae8..1acdabb637 100644 --- a/sysdeps/unix/sysv/linux/m68k/kernel-features.h +++ b/sysdeps/unix/sysv/linux/m68k/kernel-features.h @@ -24,7 +24,6 @@ # define __ASSUME_LISTEN_SYSCALL 1 # define __ASSUME_GETSOCKOPT_SYSCALL 1 # define __ASSUME_SETSOCKOPT_SYSCALL 1 -# define __ASSUME_GETSOCKNAME_SYSCALL 1 # define __ASSUME_SHUTDOWN_SYSCALL 1 #endif @@ -43,6 +42,7 @@ # undef __ASSUME_RECVFROM_SYSCALL # undef __ASSUME_SENDTO_SYSCALL # undef __ASSUME_GETPEERNAME_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 13eba077d6..84c1b144e0 100644 --- a/sysdeps/unix/sysv/linux/microblaze/kernel-features.h +++ b/sysdeps/unix/sysv/linux/microblaze/kernel-features.h @@ -21,7 +21,6 @@ #define __ASSUME_SOCKET_SYSCALL 1 #define __ASSUME_CONNECT_SYSCALL 1 #define __ASSUME_LISTEN_SYSCALL 1 -#define __ASSUME_GETSOCKNAME_SYSCALL 1 #define __ASSUME_SOCKETPAIR_SYSCALL 1 #define __ASSUME_SEND_SYSCALL 1 #define __ASSUME_RECV_SYSCALL 1 diff --git a/sysdeps/unix/sysv/linux/mips/syscalls.list b/sysdeps/unix/sysv/linux/mips/syscalls.list index a9dff10271..e2a6d1ca64 100644 --- a/sysdeps/unix/sysv/linux/mips/syscalls.list +++ b/sysdeps/unix/sysv/linux/mips/syscalls.list @@ -12,7 +12,6 @@ sysmips - sysmips i:iiii __sysmips sysmips # Socket functions; Linux/MIPS doesn't use the socketcall(2) wrapper; # it's provided for compatibility, though. # -getsockname - getsockname i:ipp __getsockname getsockname getsockopt - getsockopt i:iiiBN __getsockopt getsockopt listen - listen i:ii __listen listen setsockopt - setsockopt i:iiibn __setsockopt setsockopt diff --git a/sysdeps/unix/sysv/linux/powerpc/kernel-features.h b/sysdeps/unix/sysv/linux/powerpc/kernel-features.h index ed7d75e0a4..40a38ebe4f 100644 --- a/sysdeps/unix/sysv/linux/powerpc/kernel-features.h +++ b/sysdeps/unix/sysv/linux/powerpc/kernel-features.h @@ -21,7 +21,6 @@ #define __ASSUME_SOCKET_SYSCALL 1 #define __ASSUME_CONNECT_SYSCALL 1 #define __ASSUME_LISTEN_SYSCALL 1 -#define __ASSUME_GETSOCKNAME_SYSCALL 1 #define __ASSUME_SOCKETPAIR_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 7a7b22ed01..a3bb354246 100644 --- a/sysdeps/unix/sysv/linux/s390/kernel-features.h +++ b/sysdeps/unix/sysv/linux/s390/kernel-features.h @@ -24,7 +24,6 @@ # define __ASSUME_LISTEN_SYSCALL 1 # define __ASSUME_GETSOCKOPT_SYSCALL 1 # define __ASSUME_SETSOCKOPT_SYSCALL 1 -# define __ASSUME_GETSOCKNAME_SYSCALL 1 # define __ASSUME_SHUTDOWN_SYSCALL 1 #endif diff --git a/sysdeps/unix/sysv/linux/sh/kernel-features.h b/sysdeps/unix/sysv/linux/sh/kernel-features.h index 34109ae859..ee5b556b7b 100644 --- a/sysdeps/unix/sysv/linux/sh/kernel-features.h +++ b/sysdeps/unix/sysv/linux/sh/kernel-features.h @@ -26,7 +26,6 @@ #define __ASSUME_SOCKET_SYSCALL 1 #define __ASSUME_CONNECT_SYSCALL 1 #define __ASSUME_LISTEN_SYSCALL 1 -#define __ASSUME_GETSOCKNAME_SYSCALL 1 #define __ASSUME_SOCKETPAIR_SYSCALL 1 #define __ASSUME_SEND_SYSCALL 1 #define __ASSUME_RECV_SYSCALL 1 diff --git a/sysdeps/unix/sysv/linux/sparc/sparc64/syscalls.list b/sysdeps/unix/sysv/linux/sparc/sparc64/syscalls.list index 2acc8a1437..f20a343840 100644 --- a/sysdeps/unix/sysv/linux/sparc/sparc64/syscalls.list +++ b/sysdeps/unix/sysv/linux/sparc/sparc64/syscalls.list @@ -1,6 +1,5 @@ # File name Caller Syscall name # args Strong name Weak names -getsockname - getsockname 3 __getsockname getsockname getsockopt - getsockopt 5 __getsockopt getsockopt shutdown - shutdown 2 __shutdown shutdown socketpair - socketpair 4 __socketpair socketpair diff --git a/sysdeps/unix/sysv/linux/x86_64/syscalls.list b/sysdeps/unix/sysv/linux/x86_64/syscalls.list index f7612e6545..d9cd71773d 100644 --- a/sysdeps/unix/sysv/linux/x86_64/syscalls.list +++ b/sysdeps/unix/sysv/linux/x86_64/syscalls.list @@ -6,7 +6,6 @@ syscall_clock_gettime EXTRA clock_gettime Ei:ip __syscall_clock_gettime # proper socket implementations: -getsockname - getsockname i:ipp __getsockname getsockname getsockopt - getsockopt i:iiiBN __getsockopt getsockopt listen - listen i:ii __listen listen setsockopt - setsockopt i:iiibn __setsockopt setsockopt From patchwork Wed Nov 18 19:55:34 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adhemerval Zanella Netto X-Patchwork-Id: 41109 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id F14FD39450DA; Wed, 18 Nov 2020 19:56:22 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org F14FD39450DA DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1605729383; bh=hhLGIqR/rih+9LqXBiRURZhis77aLkWKkhVogHuEZ8c=; h=To:Subject:Date:In-Reply-To:References:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=dF7iQ79EP64pXFGS/uxIQyYALAGukpcwKrCosgeqkEJ9wmFOKTK6VodT6dU7vbQbt tCsVd16gdBuYRVh9AuJlmjXGX6f2GxB/9BYxfHvCZS7xYtYo/qAcM9+mtws7836fDR ISY961UfYu5+dWTH9Cc9dj3D7xgz5LX36JyZjzeM= X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from mail-qt1-x844.google.com (mail-qt1-x844.google.com [IPv6:2607:f8b0:4864:20::844]) by sourceware.org (Postfix) with ESMTPS id 13D1A393FC34 for ; Wed, 18 Nov 2020 19:56:13 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 13D1A393FC34 Received: by mail-qt1-x844.google.com with SMTP id v11so2550257qtq.12 for ; Wed, 18 Nov 2020 11:56:13 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=hhLGIqR/rih+9LqXBiRURZhis77aLkWKkhVogHuEZ8c=; b=Z0EZxh8sXKLCs6bCA/zP2tMlhZed5Lnx81Plf8mZaWSDPs84MXhgjoQs4SFYLd5G0n eJ1QxAqLhp9OP6p+Fru/PuxaStc3QeDKyWyiEDhCl6fodJaEN1xLylq+cUT6SwcW8zjj cVuzcdXjGi68dW9yUsavBzHPjzxxU13Es59qWeTmMjunLnCxXs6dNdOZWwAmz0dqJmKH 2cDhutVrIna7s9VfQtmyugv6+WAo8wg5sLKjbKYZVnhAY8O7d4oS9UMRIBsxN0IH3OMV RQs8vLUTnxWKfLgJHLUd9oHO0NiskvqiSMRsDFbE7etQGpcpwwXEp7qxCO1DIzj8GWNQ xJxQ== X-Gm-Message-State: AOAM533wkOYhstXGqiUAApVQJE+6bEu6283iJV+fzupi4X4mritmpa61 Po05FFHZ3wk8VYQaVXwKQZK7tzvf1SLHDQ== X-Google-Smtp-Source: ABdhPJxjG8avHv50T2wRfmGJN6Sx8flqZhTrTSmfkoqOVuj61WUmeNLmDJNvmtVEe6bREWY1OnWQsA== X-Received: by 2002:ac8:5411:: with SMTP id b17mr6481891qtq.281.1605729372359; Wed, 18 Nov 2020 11:56:12 -0800 (PST) Received: from localhost.localdomain ([177.194.48.209]) by smtp.googlemail.com with ESMTPSA id f27sm6538775qtv.95.2020.11.18.11.56.11 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 18 Nov 2020 11:56:11 -0800 (PST) To: libc-alpha@sourceware.org Subject: [PATCH 10/28] linux: Assume getsockopt support Date: Wed, 18 Nov 2020 16:55:34 -0300 Message-Id: <20201118195552.2687336-11-adhemerval.zanella@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20201118195552.2687336-1-adhemerval.zanella@linaro.org> References: <20201118195552.2687336-1-adhemerval.zanella@linaro.org> MIME-Version: 1.0 X-Spam-Status: No, score=-13.9 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Adhemerval Zanella via Libc-alpha From: Adhemerval Zanella Netto Reply-To: Adhemerval Zanella Errors-To: libc-alpha-bounces@sourceware.org Sender: "Libc-alpha" Checked with build for the affected ABI. --- sysdeps/unix/sysv/linux/alpha/syscalls.list | 1 - sysdeps/unix/sysv/linux/arm/syscalls.list | 1 - sysdeps/unix/sysv/linux/generic/syscalls.list | 1 - sysdeps/unix/sysv/linux/hppa/syscalls.list | 1 - sysdeps/unix/sysv/linux/i386/kernel-features.h | 2 +- sysdeps/unix/sysv/linux/ia64/syscalls.list | 1 - 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/mips/syscalls.list | 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 | 2 +- sysdeps/unix/sysv/linux/sparc/sparc64/syscalls.list | 1 - sysdeps/unix/sysv/linux/x86_64/syscalls.list | 1 - 16 files changed, 5 insertions(+), 15 deletions(-) diff --git a/sysdeps/unix/sysv/linux/alpha/syscalls.list b/sysdeps/unix/sysv/linux/alpha/syscalls.list index 26e4070686..6c6f53204b 100644 --- a/sysdeps/unix/sysv/linux/alpha/syscalls.list +++ b/sysdeps/unix/sysv/linux/alpha/syscalls.list @@ -5,7 +5,6 @@ sigstack - sigstack 2 sigstack getpriority - getpriority i:ii __getpriority getpriority # proper socket implementations: -getsockopt - getsockopt i:iiiBN __getsockopt getsockopt listen - listen i:ii __listen listen setsockopt - setsockopt i:iiibn __setsockopt setsockopt shutdown - shutdown i:ii __shutdown shutdown diff --git a/sysdeps/unix/sysv/linux/arm/syscalls.list b/sysdeps/unix/sysv/linux/arm/syscalls.list index 71e2b99cf5..3abab1ba72 100644 --- a/sysdeps/unix/sysv/linux/arm/syscalls.list +++ b/sysdeps/unix/sysv/linux/arm/syscalls.list @@ -20,7 +20,6 @@ prlimit64 EXTRA prlimit64 i:iipp prlimit64 fanotify_mark EXTRA fanotify_mark i:iiiiis fanotify_mark # proper socket implementations: -getsockopt - getsockopt i:iiiBN __getsockopt getsockopt listen - listen i:ii __listen listen setsockopt - setsockopt i:iiibn __setsockopt setsockopt shutdown - shutdown i:ii __shutdown shutdown diff --git a/sysdeps/unix/sysv/linux/generic/syscalls.list b/sysdeps/unix/sysv/linux/generic/syscalls.list index 5e4b8f2e29..a4862dda0e 100644 --- a/sysdeps/unix/sysv/linux/generic/syscalls.list +++ b/sysdeps/unix/sysv/linux/generic/syscalls.list @@ -5,5 +5,4 @@ socket - socket i:iii __socket socket socketpair - socketpair i:iiif __socketpair socketpair listen - listen i:ii __listen listen setsockopt - setsockopt i:iiibn __setsockopt setsockopt -getsockopt - getsockopt i:iiiBN __getsockopt getsockopt shutdown - shutdown i:ii __shutdown shutdown diff --git a/sysdeps/unix/sysv/linux/hppa/syscalls.list b/sysdeps/unix/sysv/linux/hppa/syscalls.list index ec6105c655..a989e25506 100644 --- a/sysdeps/unix/sysv/linux/hppa/syscalls.list +++ b/sysdeps/unix/sysv/linux/hppa/syscalls.list @@ -1,7 +1,6 @@ # File name Caller Syscall name # args Strong name Weak names # proper socket implementations: -getsockopt - getsockopt i:iiiBN __getsockopt getsockopt listen - listen i:ii __listen listen setsockopt - setsockopt i:iiibn __setsockopt setsockopt shutdown - shutdown i:ii __shutdown shutdown diff --git a/sysdeps/unix/sysv/linux/i386/kernel-features.h b/sysdeps/unix/sysv/linux/i386/kernel-features.h index be1cfe94b8..77cb2d9442 100644 --- a/sysdeps/unix/sysv/linux/i386/kernel-features.h +++ b/sysdeps/unix/sysv/linux/i386/kernel-features.h @@ -22,7 +22,6 @@ # define __ASSUME_SOCKET_SYSCALL 1 # define __ASSUME_SOCKETPAIR_SYSCALL 1 # define __ASSUME_LISTEN_SYSCALL 1 -# define __ASSUME_GETSOCKOPT_SYSCALL 1 # define __ASSUME_SETSOCKOPT_SYSCALL 1 # define __ASSUME_SHUTDOWN_SYSCALL 1 #endif @@ -41,6 +40,7 @@ # undef __ASSUME_SENDTO_SYSCALL # undef __ASSUME_GETPEERNAME_SYSCALL # undef __ASSUME_GETSOCKNAME_SYSCALL +# undef __ASSUME_GETSOCKOPT_SYSCALL #endif /* i686 only supports ipc syscall before 5.1. */ diff --git a/sysdeps/unix/sysv/linux/ia64/syscalls.list b/sysdeps/unix/sysv/linux/ia64/syscalls.list index 748ba3215c..f2b85d07a8 100644 --- a/sysdeps/unix/sysv/linux/ia64/syscalls.list +++ b/sysdeps/unix/sysv/linux/ia64/syscalls.list @@ -3,7 +3,6 @@ getpriority - getpriority i:ii __getpriority getpriority # proper socket implementations: -getsockopt - getsockopt i:iiiBN __getsockopt getsockopt listen - listen i:ii __listen listen setsockopt - setsockopt i:iiibn __setsockopt setsockopt shutdown - shutdown i:ii __shutdown shutdown diff --git a/sysdeps/unix/sysv/linux/kernel-features.h b/sysdeps/unix/sysv/linux/kernel-features.h index 7266f34100..46290fe31c 100644 --- a/sysdeps/unix/sysv/linux/kernel-features.h +++ b/sysdeps/unix/sysv/linux/kernel-features.h @@ -80,6 +80,7 @@ #define __ASSUME_SENDMMSG_SYSCALL 1 #define __ASSUME_GETPEERNAME_SYSCALL 1 #define __ASSUME_GETSOCKNAME_SYSCALL 1 +#define __ASSUME_GETSOCKOPT_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 1acdabb637..70b8f8ab1b 100644 --- a/sysdeps/unix/sysv/linux/m68k/kernel-features.h +++ b/sysdeps/unix/sysv/linux/m68k/kernel-features.h @@ -22,7 +22,6 @@ # define __ASSUME_SOCKET_SYSCALL 1 # define __ASSUME_SOCKETPAIR_SYSCALL 1 # define __ASSUME_LISTEN_SYSCALL 1 -# define __ASSUME_GETSOCKOPT_SYSCALL 1 # define __ASSUME_SETSOCKOPT_SYSCALL 1 # define __ASSUME_SHUTDOWN_SYSCALL 1 #endif @@ -43,6 +42,7 @@ # undef __ASSUME_SENDTO_SYSCALL # undef __ASSUME_GETPEERNAME_SYSCALL # undef __ASSUME_GETSOCKNAME_SYSCALL +# undef __ASSUME_GETSOCKOPT_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 84c1b144e0..bdad86089b 100644 --- a/sysdeps/unix/sysv/linux/microblaze/kernel-features.h +++ b/sysdeps/unix/sysv/linux/microblaze/kernel-features.h @@ -25,7 +25,6 @@ #define __ASSUME_SEND_SYSCALL 1 #define __ASSUME_RECV_SYSCALL 1 #define __ASSUME_SHUTDOWN_SYSCALL 1 -#define __ASSUME_GETSOCKOPT_SYSCALL 1 #define __ASSUME_SETSOCKOPT_SYSCALL 1 #include_next diff --git a/sysdeps/unix/sysv/linux/mips/syscalls.list b/sysdeps/unix/sysv/linux/mips/syscalls.list index e2a6d1ca64..de49b2149d 100644 --- a/sysdeps/unix/sysv/linux/mips/syscalls.list +++ b/sysdeps/unix/sysv/linux/mips/syscalls.list @@ -12,7 +12,6 @@ sysmips - sysmips i:iiii __sysmips sysmips # Socket functions; Linux/MIPS doesn't use the socketcall(2) wrapper; # it's provided for compatibility, though. # -getsockopt - getsockopt i:iiiBN __getsockopt getsockopt listen - listen i:ii __listen listen setsockopt - setsockopt i:iiibn __setsockopt setsockopt shutdown - shutdown i:ii __shutdown shutdown diff --git a/sysdeps/unix/sysv/linux/powerpc/kernel-features.h b/sysdeps/unix/sysv/linux/powerpc/kernel-features.h index 40a38ebe4f..764db320d6 100644 --- a/sysdeps/unix/sysv/linux/powerpc/kernel-features.h +++ b/sysdeps/unix/sysv/linux/powerpc/kernel-features.h @@ -25,7 +25,6 @@ #define __ASSUME_SEND_SYSCALL 1 #define __ASSUME_RECV_SYSCALL 1 #define __ASSUME_SHUTDOWN_SYSCALL 1 -#define __ASSUME_GETSOCKOPT_SYSCALL 1 #define __ASSUME_SETSOCKOPT_SYSCALL 1 /* Define this if your 32-bit syscall API requires 64-bit register diff --git a/sysdeps/unix/sysv/linux/s390/kernel-features.h b/sysdeps/unix/sysv/linux/s390/kernel-features.h index a3bb354246..2561329eda 100644 --- a/sysdeps/unix/sysv/linux/s390/kernel-features.h +++ b/sysdeps/unix/sysv/linux/s390/kernel-features.h @@ -22,7 +22,6 @@ # define __ASSUME_SOCKET_SYSCALL 1 # define __ASSUME_SOCKETPAIR_SYSCALL 1 # define __ASSUME_LISTEN_SYSCALL 1 -# define __ASSUME_GETSOCKOPT_SYSCALL 1 # define __ASSUME_SETSOCKOPT_SYSCALL 1 # define __ASSUME_SHUTDOWN_SYSCALL 1 #endif @@ -42,6 +41,7 @@ # undef __ASSUME_RECVFROM_SYSCALL # undef __ASSUME_SENDTO_SYSCALL # undef __ASSUME_GETPEERNAME_SYSCALL +# undef __ASSUME_GETSOCKOPT_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 ee5b556b7b..3aa20427d2 100644 --- a/sysdeps/unix/sysv/linux/sh/kernel-features.h +++ b/sysdeps/unix/sysv/linux/sh/kernel-features.h @@ -30,7 +30,6 @@ #define __ASSUME_SEND_SYSCALL 1 #define __ASSUME_RECV_SYSCALL 1 #define __ASSUME_SHUTDOWN_SYSCALL 1 -#define __ASSUME_GETSOCKOPT_SYSCALL 1 #define __ASSUME_SETSOCKOPT_SYSCALL 1 #include_next diff --git a/sysdeps/unix/sysv/linux/sparc/kernel-features.h b/sysdeps/unix/sysv/linux/sparc/kernel-features.h index 8f7348d9ad..dbe34face6 100644 --- a/sysdeps/unix/sysv/linux/sparc/kernel-features.h +++ b/sysdeps/unix/sysv/linux/sparc/kernel-features.h @@ -38,10 +38,10 @@ # undef __ASSUME_CONNECT_SYSCALL # undef __ASSUME_RECVFROM_SYSCALL # undef __ASSUME_SENDTO_SYSCALL +# undef __ASSUME_GETSOCKOPT_SYSCALL #else # define __ASSUME_SOCKET_SYSCALL 1 # define __ASSUME_SOCKETPAIR_SYSCALL 1 -# define __ASSUME_GETSOCKOPT_SYSCALL 1 # define __ASSUME_SHUTDOWN_SYSCALL 1 #endif diff --git a/sysdeps/unix/sysv/linux/sparc/sparc64/syscalls.list b/sysdeps/unix/sysv/linux/sparc/sparc64/syscalls.list index f20a343840..0f878a2f3f 100644 --- a/sysdeps/unix/sysv/linux/sparc/sparc64/syscalls.list +++ b/sysdeps/unix/sysv/linux/sparc/sparc64/syscalls.list @@ -1,5 +1,4 @@ # File name Caller Syscall name # args Strong name Weak names -getsockopt - getsockopt 5 __getsockopt getsockopt shutdown - shutdown 2 __shutdown shutdown socketpair - socketpair 4 __socketpair socketpair diff --git a/sysdeps/unix/sysv/linux/x86_64/syscalls.list b/sysdeps/unix/sysv/linux/x86_64/syscalls.list index d9cd71773d..c6c4bafe9b 100644 --- a/sysdeps/unix/sysv/linux/x86_64/syscalls.list +++ b/sysdeps/unix/sysv/linux/x86_64/syscalls.list @@ -6,7 +6,6 @@ syscall_clock_gettime EXTRA clock_gettime Ei:ip __syscall_clock_gettime # proper socket implementations: -getsockopt - getsockopt i:iiiBN __getsockopt getsockopt listen - listen i:ii __listen listen setsockopt - setsockopt i:iiibn __setsockopt setsockopt shutdown - shutdown i:ii __shutdown shutdown From patchwork Wed Nov 18 19:55:35 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adhemerval Zanella Netto X-Patchwork-Id: 41112 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 7780839450F4; Wed, 18 Nov 2020 19:56:26 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 7780839450F4 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1605729386; bh=l6/o0B5UPq4kS/deqZVjsJMzN6gWX83Py7Gz7mcq5vc=; h=To:Subject:Date:In-Reply-To:References:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=nbI61NLFzrYL0rrJBjwlgeMGzk5H7Z7fWS4jcDvt8jPwrhQu4aWrtyEfRotjL1IhV SXHf8X/dLrjHmJjSmiZndc939jJzEK5rVw79uYq4RdcgMlNwnvwdtifV+c9ABMJAL1 arlqZxaoTW41IigVY1oMcYj30E+ajxOMLSjak1HA= X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from mail-qt1-x843.google.com (mail-qt1-x843.google.com [IPv6:2607:f8b0:4864:20::843]) by sourceware.org (Postfix) with ESMTPS id 9421C3944430 for ; Wed, 18 Nov 2020 19:56:14 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 9421C3944430 Received: by mail-qt1-x843.google.com with SMTP id i12so2631898qtj.0 for ; Wed, 18 Nov 2020 11:56:14 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=l6/o0B5UPq4kS/deqZVjsJMzN6gWX83Py7Gz7mcq5vc=; b=juca8Z/bsCcm3IzdB/UcrEJDTiGsUEhq0vC170n6FXwXzNHqyrd30jb6Q04UV2TTdY XRKWb2WXiWWWtUzRX9yXIiK+WpyQgpFpY3Wmxoo6YelRZ+OxhEhpGMm65+YxMwFrsuTK Sqky6c7yS3MaKokESN5qand0OAwTZ+L9JE5Nz1VHBzYMj3FPzKblorFtmllmUlzIN4oe eZ2cQw+ASQGl4MfT0CyzzY8cSFFrka05xizunwoy1svucvTcepI4/VlGdh+dFwbg9Iks EiRUBoZ2xcoJ3yy0ku5LN4jokQRjOpo7uVfJp8ans6H4t4eXYoCA0ULOurKVrakCb5Iv KPCQ== X-Gm-Message-State: AOAM533Nx6yJ5c9VS8rVhydyqhYTWiPUk9GgZDtsT1icUkkeb2Ajfvhk DLnCbbbuOM8dOm1ilpQM0vXSMyMMYxJifw== X-Google-Smtp-Source: ABdhPJy4Az0CKAWN/gTu7svFyC67hxDTWfKfyVL4HmKlEj7TzkZ3QfLFI+88yIPchz5kg9GpNA5PkA== X-Received: by 2002:aed:2aa5:: with SMTP id t34mr6324734qtd.31.1605729373778; Wed, 18 Nov 2020 11:56:13 -0800 (PST) Received: from localhost.localdomain ([177.194.48.209]) by smtp.googlemail.com with ESMTPSA id f27sm6538775qtv.95.2020.11.18.11.56.12 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 18 Nov 2020 11:56:13 -0800 (PST) To: libc-alpha@sourceware.org Subject: [PATCH 11/28] linux: Assume listen support Date: Wed, 18 Nov 2020 16:55:35 -0300 Message-Id: <20201118195552.2687336-12-adhemerval.zanella@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20201118195552.2687336-1-adhemerval.zanella@linaro.org> References: <20201118195552.2687336-1-adhemerval.zanella@linaro.org> MIME-Version: 1.0 X-Spam-Status: No, score=-13.9 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Adhemerval Zanella via Libc-alpha From: Adhemerval Zanella Netto Reply-To: Adhemerval Zanella Errors-To: libc-alpha-bounces@sourceware.org Sender: "Libc-alpha" Checked with build for the affected ABI. --- sysdeps/unix/sysv/linux/alpha/syscalls.list | 1 - sysdeps/unix/sysv/linux/arm/syscalls.list | 1 - sysdeps/unix/sysv/linux/generic/syscalls.list | 1 - sysdeps/unix/sysv/linux/hppa/syscalls.list | 1 - sysdeps/unix/sysv/linux/i386/kernel-features.h | 2 +- sysdeps/unix/sysv/linux/ia64/syscalls.list | 1 - 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/mips/syscalls.list | 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 | 2 +- sysdeps/unix/sysv/linux/x86_64/syscalls.list | 1 - 15 files changed, 5 insertions(+), 14 deletions(-) diff --git a/sysdeps/unix/sysv/linux/alpha/syscalls.list b/sysdeps/unix/sysv/linux/alpha/syscalls.list index 6c6f53204b..cafe9487e9 100644 --- a/sysdeps/unix/sysv/linux/alpha/syscalls.list +++ b/sysdeps/unix/sysv/linux/alpha/syscalls.list @@ -5,7 +5,6 @@ sigstack - sigstack 2 sigstack getpriority - getpriority i:ii __getpriority getpriority # proper socket implementations: -listen - listen i:ii __listen listen setsockopt - setsockopt i:iiibn __setsockopt setsockopt shutdown - shutdown i:ii __shutdown shutdown socket - socket i:iii __socket socket diff --git a/sysdeps/unix/sysv/linux/arm/syscalls.list b/sysdeps/unix/sysv/linux/arm/syscalls.list index 3abab1ba72..8d7d7cec8c 100644 --- a/sysdeps/unix/sysv/linux/arm/syscalls.list +++ b/sysdeps/unix/sysv/linux/arm/syscalls.list @@ -20,7 +20,6 @@ prlimit64 EXTRA prlimit64 i:iipp prlimit64 fanotify_mark EXTRA fanotify_mark i:iiiiis fanotify_mark # proper socket implementations: -listen - listen i:ii __listen listen setsockopt - setsockopt i:iiibn __setsockopt setsockopt shutdown - shutdown i:ii __shutdown shutdown socket - socket i:iii __socket socket diff --git a/sysdeps/unix/sysv/linux/generic/syscalls.list b/sysdeps/unix/sysv/linux/generic/syscalls.list index a4862dda0e..db3cdcb1be 100644 --- a/sysdeps/unix/sysv/linux/generic/syscalls.list +++ b/sysdeps/unix/sysv/linux/generic/syscalls.list @@ -3,6 +3,5 @@ # Socket APIs socket - socket i:iii __socket socket socketpair - socketpair i:iiif __socketpair socketpair -listen - listen i:ii __listen listen setsockopt - setsockopt i:iiibn __setsockopt setsockopt shutdown - shutdown i:ii __shutdown shutdown diff --git a/sysdeps/unix/sysv/linux/hppa/syscalls.list b/sysdeps/unix/sysv/linux/hppa/syscalls.list index a989e25506..de7e471117 100644 --- a/sysdeps/unix/sysv/linux/hppa/syscalls.list +++ b/sysdeps/unix/sysv/linux/hppa/syscalls.list @@ -1,7 +1,6 @@ # File name Caller Syscall name # args Strong name Weak names # proper socket implementations: -listen - listen i:ii __listen listen setsockopt - setsockopt i:iiibn __setsockopt setsockopt shutdown - shutdown i:ii __shutdown shutdown socket - socket i:iii __socket socket diff --git a/sysdeps/unix/sysv/linux/i386/kernel-features.h b/sysdeps/unix/sysv/linux/i386/kernel-features.h index 77cb2d9442..f87fe786cf 100644 --- a/sysdeps/unix/sysv/linux/i386/kernel-features.h +++ b/sysdeps/unix/sysv/linux/i386/kernel-features.h @@ -21,7 +21,6 @@ #if __LINUX_KERNEL_VERSION >= 0x040300 # define __ASSUME_SOCKET_SYSCALL 1 # define __ASSUME_SOCKETPAIR_SYSCALL 1 -# define __ASSUME_LISTEN_SYSCALL 1 # define __ASSUME_SETSOCKOPT_SYSCALL 1 # define __ASSUME_SHUTDOWN_SYSCALL 1 #endif @@ -41,6 +40,7 @@ # undef __ASSUME_GETPEERNAME_SYSCALL # undef __ASSUME_GETSOCKNAME_SYSCALL # undef __ASSUME_GETSOCKOPT_SYSCALL +# undef __ASSUME_LISTEN_SYSCALL #endif /* i686 only supports ipc syscall before 5.1. */ diff --git a/sysdeps/unix/sysv/linux/ia64/syscalls.list b/sysdeps/unix/sysv/linux/ia64/syscalls.list index f2b85d07a8..4a9cec62f5 100644 --- a/sysdeps/unix/sysv/linux/ia64/syscalls.list +++ b/sysdeps/unix/sysv/linux/ia64/syscalls.list @@ -3,7 +3,6 @@ getpriority - getpriority i:ii __getpriority getpriority # proper socket implementations: -listen - listen i:ii __listen listen setsockopt - setsockopt i:iiibn __setsockopt setsockopt shutdown - shutdown i:ii __shutdown shutdown socket - socket i:iii __socket socket diff --git a/sysdeps/unix/sysv/linux/kernel-features.h b/sysdeps/unix/sysv/linux/kernel-features.h index 46290fe31c..990b7ca5bd 100644 --- a/sysdeps/unix/sysv/linux/kernel-features.h +++ b/sysdeps/unix/sysv/linux/kernel-features.h @@ -81,6 +81,7 @@ #define __ASSUME_GETPEERNAME_SYSCALL 1 #define __ASSUME_GETSOCKNAME_SYSCALL 1 #define __ASSUME_GETSOCKOPT_SYSCALL 1 +#define __ASSUME_LISTEN_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 70b8f8ab1b..997dc47b2a 100644 --- a/sysdeps/unix/sysv/linux/m68k/kernel-features.h +++ b/sysdeps/unix/sysv/linux/m68k/kernel-features.h @@ -21,7 +21,6 @@ #if __LINUX_KERNEL_VERSION >= 0x040300 # define __ASSUME_SOCKET_SYSCALL 1 # define __ASSUME_SOCKETPAIR_SYSCALL 1 -# define __ASSUME_LISTEN_SYSCALL 1 # define __ASSUME_SETSOCKOPT_SYSCALL 1 # define __ASSUME_SHUTDOWN_SYSCALL 1 #endif @@ -43,6 +42,7 @@ # undef __ASSUME_GETPEERNAME_SYSCALL # undef __ASSUME_GETSOCKNAME_SYSCALL # undef __ASSUME_GETSOCKOPT_SYSCALL +# undef __ASSUME_LISTEN_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 bdad86089b..3f9386d19b 100644 --- a/sysdeps/unix/sysv/linux/microblaze/kernel-features.h +++ b/sysdeps/unix/sysv/linux/microblaze/kernel-features.h @@ -20,7 +20,6 @@ /* All supported kernel versions for MicroBlaze have these syscalls. */ #define __ASSUME_SOCKET_SYSCALL 1 #define __ASSUME_CONNECT_SYSCALL 1 -#define __ASSUME_LISTEN_SYSCALL 1 #define __ASSUME_SOCKETPAIR_SYSCALL 1 #define __ASSUME_SEND_SYSCALL 1 #define __ASSUME_RECV_SYSCALL 1 diff --git a/sysdeps/unix/sysv/linux/mips/syscalls.list b/sysdeps/unix/sysv/linux/mips/syscalls.list index de49b2149d..df1e2eb126 100644 --- a/sysdeps/unix/sysv/linux/mips/syscalls.list +++ b/sysdeps/unix/sysv/linux/mips/syscalls.list @@ -12,7 +12,6 @@ sysmips - sysmips i:iiii __sysmips sysmips # Socket functions; Linux/MIPS doesn't use the socketcall(2) wrapper; # it's provided for compatibility, though. # -listen - listen i:ii __listen listen setsockopt - setsockopt i:iiibn __setsockopt setsockopt shutdown - shutdown i:ii __shutdown shutdown socket - socket i:iii __socket socket diff --git a/sysdeps/unix/sysv/linux/powerpc/kernel-features.h b/sysdeps/unix/sysv/linux/powerpc/kernel-features.h index 764db320d6..8ca8d097b7 100644 --- a/sysdeps/unix/sysv/linux/powerpc/kernel-features.h +++ b/sysdeps/unix/sysv/linux/powerpc/kernel-features.h @@ -20,7 +20,6 @@ /* New syscalls added for PowerPC in 2.6.37. */ #define __ASSUME_SOCKET_SYSCALL 1 #define __ASSUME_CONNECT_SYSCALL 1 -#define __ASSUME_LISTEN_SYSCALL 1 #define __ASSUME_SOCKETPAIR_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 2561329eda..2a0f07a41c 100644 --- a/sysdeps/unix/sysv/linux/s390/kernel-features.h +++ b/sysdeps/unix/sysv/linux/s390/kernel-features.h @@ -21,7 +21,6 @@ #if __LINUX_KERNEL_VERSION >= 0x040300 # define __ASSUME_SOCKET_SYSCALL 1 # define __ASSUME_SOCKETPAIR_SYSCALL 1 -# define __ASSUME_LISTEN_SYSCALL 1 # define __ASSUME_SETSOCKOPT_SYSCALL 1 # define __ASSUME_SHUTDOWN_SYSCALL 1 #endif @@ -42,6 +41,7 @@ # undef __ASSUME_SENDTO_SYSCALL # undef __ASSUME_GETPEERNAME_SYSCALL # undef __ASSUME_GETSOCKOPT_SYSCALL +# undef __ASSUME_LISTEN_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 3aa20427d2..19343d478a 100644 --- a/sysdeps/unix/sysv/linux/sh/kernel-features.h +++ b/sysdeps/unix/sysv/linux/sh/kernel-features.h @@ -25,7 +25,6 @@ /* These syscalls were added for SH in 2.6.37. */ #define __ASSUME_SOCKET_SYSCALL 1 #define __ASSUME_CONNECT_SYSCALL 1 -#define __ASSUME_LISTEN_SYSCALL 1 #define __ASSUME_SOCKETPAIR_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 dbe34face6..8619f4bc38 100644 --- a/sysdeps/unix/sysv/linux/sparc/kernel-features.h +++ b/sysdeps/unix/sysv/linux/sparc/kernel-features.h @@ -47,11 +47,11 @@ #if __LINUX_KERNEL_VERSION < 0x040400 # undef __ASSUME_BIND_SYSCALL +# undef __ASSUME_LISTEN_SYSCALL #endif /* These syscalls were added for both 32-bit and 64-bit in 4.4. */ #if __LINUX_KERNEL_VERSION >= 0x040400 -# define __ASSUME_LISTEN_SYSCALL 1 # define __ASSUME_SETSOCKOPT_SYSCALL 1 #endif diff --git a/sysdeps/unix/sysv/linux/x86_64/syscalls.list b/sysdeps/unix/sysv/linux/x86_64/syscalls.list index c6c4bafe9b..d583b64d6f 100644 --- a/sysdeps/unix/sysv/linux/x86_64/syscalls.list +++ b/sysdeps/unix/sysv/linux/x86_64/syscalls.list @@ -6,7 +6,6 @@ syscall_clock_gettime EXTRA clock_gettime Ei:ip __syscall_clock_gettime # proper socket implementations: -listen - listen i:ii __listen listen setsockopt - setsockopt i:iiibn __setsockopt setsockopt shutdown - shutdown i:ii __shutdown shutdown socket - socket i:iii __socket socket From patchwork Wed Nov 18 19:55:36 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adhemerval Zanella Netto X-Patchwork-Id: 41110 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 68AC939450E7; Wed, 18 Nov 2020 19:56:25 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 68AC939450E7 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1605729385; bh=+6HrNknUXhTenJ0zeotJZkCf87hSmR8/G7K+sRHYJpU=; h=To:Subject:Date:In-Reply-To:References:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=PSf7hzI5py/8oXzAW+2LKM0WGvzhiPdNLZXUIqQYSk0Cqp54PBJg1dYgIyUaBFS6m Foe9++zC4xVGYtKcVQH2ByN4v8Bs8wLzjltvZ/jWIjOpSAO/vf79GNDlzggg1S4w0H UIebXkWrrfu1PsBy03fiut6pMS9sWktP1CpGF6VE= X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from mail-qv1-xf41.google.com (mail-qv1-xf41.google.com [IPv6:2607:f8b0:4864:20::f41]) by sourceware.org (Postfix) with ESMTPS id EC52D39450C4 for ; Wed, 18 Nov 2020 19:56:15 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org EC52D39450C4 Received: by mail-qv1-xf41.google.com with SMTP id r12so1635071qvq.13 for ; Wed, 18 Nov 2020 11:56:15 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=+6HrNknUXhTenJ0zeotJZkCf87hSmR8/G7K+sRHYJpU=; b=uKRLglHDKnVZNnua/REo2/9qp/jXMc9r2yq4MDyckl4/D236PUqGQW9cUY7d6+1o9A L9PFVljXQPAGrRmF2rCK/OEJaDZ0WSeyPcaOzu3kN5Gm1S4TJ/rDb8UtzwYar/+Ri424 kf/ggWSvgybQYb/pi3+SocEBwGF/YgJhhOkz70rfB8xy7k3bqygkS/wrHvff/r6Yk38p nUHEH639boblId8miIWFoXJyo3fC/t8fRhPSrygMEksSsoYNiMzL5k5ow5skj9mPjPwc gCWsIIi2mYUSmDTjdpq+VVUUKxpNKAzjwG4wuAuXC1cVBAPsKIU0FiRnR23VKJ1px7MZ +OBQ== X-Gm-Message-State: AOAM5323WFpPKTdiZyIedkJoT81E/paIy8U/dyg/M8zS1V0g8wY0jQW0 /O9rrJkYxDhjMOY10G1RlmUs0nETSLnvZw== X-Google-Smtp-Source: ABdhPJwjS85mpYMzh3agxe3R6VHbTawwP3hQv3VikvzcA5k+We110wJnKiLcxnJCPqTEvACzK6IvTg== X-Received: by 2002:a05:6214:9c4:: with SMTP id dp4mr6114848qvb.44.1605729375170; Wed, 18 Nov 2020 11:56:15 -0800 (PST) Received: from localhost.localdomain ([177.194.48.209]) by smtp.googlemail.com with ESMTPSA id f27sm6538775qtv.95.2020.11.18.11.56.14 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 18 Nov 2020 11:56:14 -0800 (PST) To: libc-alpha@sourceware.org Subject: [PATCH 12/28] linux: Assume setsockopt support Date: Wed, 18 Nov 2020 16:55:36 -0300 Message-Id: <20201118195552.2687336-13-adhemerval.zanella@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20201118195552.2687336-1-adhemerval.zanella@linaro.org> References: <20201118195552.2687336-1-adhemerval.zanella@linaro.org> MIME-Version: 1.0 X-Spam-Status: No, score=-13.9 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Adhemerval Zanella via Libc-alpha From: Adhemerval Zanella Netto Reply-To: Adhemerval Zanella Errors-To: libc-alpha-bounces@sourceware.org Sender: "Libc-alpha" Checked with build for the affected ABI. --- sysdeps/unix/sysv/linux/alpha/syscalls.list | 1 - sysdeps/unix/sysv/linux/arm/syscalls.list | 1 - sysdeps/unix/sysv/linux/generic/syscalls.list | 1 - sysdeps/unix/sysv/linux/hppa/syscalls.list | 1 - sysdeps/unix/sysv/linux/i386/kernel-features.h | 2 +- sysdeps/unix/sysv/linux/ia64/syscalls.list | 1 - 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/mips/syscalls.list | 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 | 7 ++----- sysdeps/unix/sysv/linux/x86_64/syscalls.list | 1 - 15 files changed, 6 insertions(+), 18 deletions(-) diff --git a/sysdeps/unix/sysv/linux/alpha/syscalls.list b/sysdeps/unix/sysv/linux/alpha/syscalls.list index cafe9487e9..6509fd08df 100644 --- a/sysdeps/unix/sysv/linux/alpha/syscalls.list +++ b/sysdeps/unix/sysv/linux/alpha/syscalls.list @@ -5,7 +5,6 @@ sigstack - sigstack 2 sigstack getpriority - getpriority i:ii __getpriority getpriority # proper socket implementations: -setsockopt - setsockopt i:iiibn __setsockopt setsockopt shutdown - shutdown i:ii __shutdown shutdown socket - socket i:iii __socket socket socketpair - socketpair i:iiif __socketpair socketpair diff --git a/sysdeps/unix/sysv/linux/arm/syscalls.list b/sysdeps/unix/sysv/linux/arm/syscalls.list index 8d7d7cec8c..ef2b3bbdfa 100644 --- a/sysdeps/unix/sysv/linux/arm/syscalls.list +++ b/sysdeps/unix/sysv/linux/arm/syscalls.list @@ -20,7 +20,6 @@ prlimit64 EXTRA prlimit64 i:iipp prlimit64 fanotify_mark EXTRA fanotify_mark i:iiiiis fanotify_mark # proper socket implementations: -setsockopt - setsockopt i:iiibn __setsockopt setsockopt shutdown - shutdown i:ii __shutdown shutdown socket - socket i:iii __socket socket socketpair - socketpair i:iiif __socketpair socketpair diff --git a/sysdeps/unix/sysv/linux/generic/syscalls.list b/sysdeps/unix/sysv/linux/generic/syscalls.list index db3cdcb1be..9e42520f12 100644 --- a/sysdeps/unix/sysv/linux/generic/syscalls.list +++ b/sysdeps/unix/sysv/linux/generic/syscalls.list @@ -3,5 +3,4 @@ # Socket APIs socket - socket i:iii __socket socket socketpair - socketpair i:iiif __socketpair socketpair -setsockopt - setsockopt i:iiibn __setsockopt setsockopt shutdown - shutdown i:ii __shutdown shutdown diff --git a/sysdeps/unix/sysv/linux/hppa/syscalls.list b/sysdeps/unix/sysv/linux/hppa/syscalls.list index de7e471117..247e1b5831 100644 --- a/sysdeps/unix/sysv/linux/hppa/syscalls.list +++ b/sysdeps/unix/sysv/linux/hppa/syscalls.list @@ -1,7 +1,6 @@ # File name Caller Syscall name # args Strong name Weak names # proper socket implementations: -setsockopt - setsockopt i:iiibn __setsockopt setsockopt shutdown - shutdown i:ii __shutdown shutdown socket - socket i:iii __socket socket socketpair - socketpair i:iiif __socketpair socketpair diff --git a/sysdeps/unix/sysv/linux/i386/kernel-features.h b/sysdeps/unix/sysv/linux/i386/kernel-features.h index f87fe786cf..ccf81a2634 100644 --- a/sysdeps/unix/sysv/linux/i386/kernel-features.h +++ b/sysdeps/unix/sysv/linux/i386/kernel-features.h @@ -21,7 +21,6 @@ #if __LINUX_KERNEL_VERSION >= 0x040300 # define __ASSUME_SOCKET_SYSCALL 1 # define __ASSUME_SOCKETPAIR_SYSCALL 1 -# define __ASSUME_SETSOCKOPT_SYSCALL 1 # define __ASSUME_SHUTDOWN_SYSCALL 1 #endif @@ -41,6 +40,7 @@ # undef __ASSUME_GETSOCKNAME_SYSCALL # undef __ASSUME_GETSOCKOPT_SYSCALL # undef __ASSUME_LISTEN_SYSCALL +# undef __ASSUME_SETSOCKOPT_SYSCALL #endif /* i686 only supports ipc syscall before 5.1. */ diff --git a/sysdeps/unix/sysv/linux/ia64/syscalls.list b/sysdeps/unix/sysv/linux/ia64/syscalls.list index 4a9cec62f5..3a3cfe5d2a 100644 --- a/sysdeps/unix/sysv/linux/ia64/syscalls.list +++ b/sysdeps/unix/sysv/linux/ia64/syscalls.list @@ -3,7 +3,6 @@ getpriority - getpriority i:ii __getpriority getpriority # proper socket implementations: -setsockopt - setsockopt i:iiibn __setsockopt setsockopt shutdown - shutdown i:ii __shutdown shutdown socket - socket i:iii __socket socket socketpair - socketpair i:iiif __socketpair socketpair diff --git a/sysdeps/unix/sysv/linux/kernel-features.h b/sysdeps/unix/sysv/linux/kernel-features.h index 990b7ca5bd..fcf42866a5 100644 --- a/sysdeps/unix/sysv/linux/kernel-features.h +++ b/sysdeps/unix/sysv/linux/kernel-features.h @@ -82,6 +82,7 @@ #define __ASSUME_GETSOCKNAME_SYSCALL 1 #define __ASSUME_GETSOCKOPT_SYSCALL 1 #define __ASSUME_LISTEN_SYSCALL 1 +#define __ASSUME_SETSOCKOPT_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 997dc47b2a..0db2aa8592 100644 --- a/sysdeps/unix/sysv/linux/m68k/kernel-features.h +++ b/sysdeps/unix/sysv/linux/m68k/kernel-features.h @@ -21,7 +21,6 @@ #if __LINUX_KERNEL_VERSION >= 0x040300 # define __ASSUME_SOCKET_SYSCALL 1 # define __ASSUME_SOCKETPAIR_SYSCALL 1 -# define __ASSUME_SETSOCKOPT_SYSCALL 1 # define __ASSUME_SHUTDOWN_SYSCALL 1 #endif @@ -43,6 +42,7 @@ # undef __ASSUME_GETSOCKNAME_SYSCALL # undef __ASSUME_GETSOCKOPT_SYSCALL # undef __ASSUME_LISTEN_SYSCALL +# undef __ASSUME_SETSOCKOPT_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 3f9386d19b..30aa9e7550 100644 --- a/sysdeps/unix/sysv/linux/microblaze/kernel-features.h +++ b/sysdeps/unix/sysv/linux/microblaze/kernel-features.h @@ -24,7 +24,6 @@ #define __ASSUME_SEND_SYSCALL 1 #define __ASSUME_RECV_SYSCALL 1 #define __ASSUME_SHUTDOWN_SYSCALL 1 -#define __ASSUME_SETSOCKOPT_SYSCALL 1 #include_next diff --git a/sysdeps/unix/sysv/linux/mips/syscalls.list b/sysdeps/unix/sysv/linux/mips/syscalls.list index df1e2eb126..2d7a83d22f 100644 --- a/sysdeps/unix/sysv/linux/mips/syscalls.list +++ b/sysdeps/unix/sysv/linux/mips/syscalls.list @@ -12,7 +12,6 @@ sysmips - sysmips i:iiii __sysmips sysmips # Socket functions; Linux/MIPS doesn't use the socketcall(2) wrapper; # it's provided for compatibility, though. # -setsockopt - setsockopt i:iiibn __setsockopt setsockopt shutdown - shutdown i:ii __shutdown shutdown socket - socket i:iii __socket socket socketpair - socketpair i:iiif __socketpair socketpair diff --git a/sysdeps/unix/sysv/linux/powerpc/kernel-features.h b/sysdeps/unix/sysv/linux/powerpc/kernel-features.h index 8ca8d097b7..f6d4135358 100644 --- a/sysdeps/unix/sysv/linux/powerpc/kernel-features.h +++ b/sysdeps/unix/sysv/linux/powerpc/kernel-features.h @@ -24,7 +24,6 @@ #define __ASSUME_SEND_SYSCALL 1 #define __ASSUME_RECV_SYSCALL 1 #define __ASSUME_SHUTDOWN_SYSCALL 1 -#define __ASSUME_SETSOCKOPT_SYSCALL 1 /* Define this if your 32-bit syscall API requires 64-bit register pairs to start with an even-number register. */ diff --git a/sysdeps/unix/sysv/linux/s390/kernel-features.h b/sysdeps/unix/sysv/linux/s390/kernel-features.h index 2a0f07a41c..0dfe56e536 100644 --- a/sysdeps/unix/sysv/linux/s390/kernel-features.h +++ b/sysdeps/unix/sysv/linux/s390/kernel-features.h @@ -21,7 +21,6 @@ #if __LINUX_KERNEL_VERSION >= 0x040300 # define __ASSUME_SOCKET_SYSCALL 1 # define __ASSUME_SOCKETPAIR_SYSCALL 1 -# define __ASSUME_SETSOCKOPT_SYSCALL 1 # define __ASSUME_SHUTDOWN_SYSCALL 1 #endif @@ -42,6 +41,7 @@ # undef __ASSUME_GETPEERNAME_SYSCALL # undef __ASSUME_GETSOCKOPT_SYSCALL # undef __ASSUME_LISTEN_SYSCALL +# undef __ASSUME_SETSOCKOPT_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 19343d478a..b36000df4c 100644 --- a/sysdeps/unix/sysv/linux/sh/kernel-features.h +++ b/sysdeps/unix/sysv/linux/sh/kernel-features.h @@ -29,7 +29,6 @@ #define __ASSUME_SEND_SYSCALL 1 #define __ASSUME_RECV_SYSCALL 1 #define __ASSUME_SHUTDOWN_SYSCALL 1 -#define __ASSUME_SETSOCKOPT_SYSCALL 1 #include_next diff --git a/sysdeps/unix/sysv/linux/sparc/kernel-features.h b/sysdeps/unix/sysv/linux/sparc/kernel-features.h index 8619f4bc38..430d6503cb 100644 --- a/sysdeps/unix/sysv/linux/sparc/kernel-features.h +++ b/sysdeps/unix/sysv/linux/sparc/kernel-features.h @@ -45,14 +45,11 @@ # define __ASSUME_SHUTDOWN_SYSCALL 1 #endif +/* These syscalls were added for both 32-bit and 64-bit in 4.4. */ #if __LINUX_KERNEL_VERSION < 0x040400 # undef __ASSUME_BIND_SYSCALL # undef __ASSUME_LISTEN_SYSCALL -#endif - -/* These syscalls were added for both 32-bit and 64-bit in 4.4. */ -#if __LINUX_KERNEL_VERSION >= 0x040400 -# define __ASSUME_SETSOCKOPT_SYSCALL 1 +# undef __ASSUME_SETSOCKOPT_SYSCALL #endif #ifdef __arch64__ diff --git a/sysdeps/unix/sysv/linux/x86_64/syscalls.list b/sysdeps/unix/sysv/linux/x86_64/syscalls.list index d583b64d6f..8463099365 100644 --- a/sysdeps/unix/sysv/linux/x86_64/syscalls.list +++ b/sysdeps/unix/sysv/linux/x86_64/syscalls.list @@ -6,7 +6,6 @@ syscall_clock_gettime EXTRA clock_gettime Ei:ip __syscall_clock_gettime # proper socket implementations: -setsockopt - setsockopt i:iiibn __setsockopt setsockopt shutdown - shutdown i:ii __shutdown shutdown socket - socket i:iii __socket socket socketpair - socketpair i:iiif __socketpair socketpair From patchwork Wed Nov 18 19:55:37 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adhemerval Zanella Netto X-Patchwork-Id: 41111 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id EBCAB39450EE; Wed, 18 Nov 2020 19:56:25 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org EBCAB39450EE DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1605729386; bh=+MLrqkOh7aXpWS681rpL76jTncVYZ1UNyy9IfaSqqSQ=; h=To:Subject:Date:In-Reply-To:References:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=KPvmxvZZK1SuO7Ojma4Gmg1iwt0afqAp619gtsENYxE6T30mXG041Do2LUd6zw9Np Eb2UYaY3pVFJutYSovRRsnFEslLlwLiE/D26h/s8ZxW99b66u865s0cLdXEAzObnG4 Mmy0mv4lXL8BAE6smOUrZyFJTreZnOIk0JG2LlQE= X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from mail-qv1-xf41.google.com (mail-qv1-xf41.google.com [IPv6:2607:f8b0:4864:20::f41]) by sourceware.org (Postfix) with ESMTPS id 47D69393C874 for ; Wed, 18 Nov 2020 19:56:17 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 47D69393C874 Received: by mail-qv1-xf41.google.com with SMTP id e14so1676121qve.3 for ; Wed, 18 Nov 2020 11:56:17 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=+MLrqkOh7aXpWS681rpL76jTncVYZ1UNyy9IfaSqqSQ=; b=D4gzMJWeQEoj5ubzG3QMTwQsKcgnrM8JUMddxauoY7WexhShmwJqxhTyu5dBn2xnvH qLJxlGiltjMp8snNiSlh9cwfYnDZuXeKfiQqsDUk87vh7MbDH3rUm5fZLmISVAPS2ux9 Dk3+cU+tLVeriXHY+deQUQjlfjX/N34LS0kw382SyEZNg6FvKBjMKyyKBUSxGoB8kbu5 WU1YuKzaB0Z6PC/xYsffYijqpCdXHULTVKNMbcZVVWp1iUZnvo+6aEHIasJGm0+zwyZd /c63ISg2koV+BFMIpIW+azLSeEBuPnO/pp3RHJRACAp6I1gyathfWcnMhYYnWCMnR0g+ ufEw== X-Gm-Message-State: AOAM532TZHYRpMsrfS7cQ1b5dIgOz0qbXyD1rRzx98AfJP2B3569yYiE 0HxEdEoRi7zUCUoZjgxtRJMVbjLf9Y/DTg== X-Google-Smtp-Source: ABdhPJwAnzpG9AAi/12jobLgjSqlTUJ45hKsQLx8Ir7X2nwLa8Co8whWW7p3X3//YmOjxpHyaRB5Kg== X-Received: by 2002:a0c:8644:: with SMTP id p62mr6463429qva.30.1605729376507; Wed, 18 Nov 2020 11:56:16 -0800 (PST) Received: from localhost.localdomain ([177.194.48.209]) by smtp.googlemail.com with ESMTPSA id f27sm6538775qtv.95.2020.11.18.11.56.15 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 18 Nov 2020 11:56:16 -0800 (PST) To: libc-alpha@sourceware.org Subject: [PATCH 13/28] linux: Assume shutdown support Date: Wed, 18 Nov 2020 16:55:37 -0300 Message-Id: <20201118195552.2687336-14-adhemerval.zanella@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20201118195552.2687336-1-adhemerval.zanella@linaro.org> References: <20201118195552.2687336-1-adhemerval.zanella@linaro.org> MIME-Version: 1.0 X-Spam-Status: No, score=-13.9 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Adhemerval Zanella via Libc-alpha From: Adhemerval Zanella Netto Reply-To: Adhemerval Zanella Errors-To: libc-alpha-bounces@sourceware.org Sender: "Libc-alpha" Checked with build for the affected ABI. --- sysdeps/unix/sysv/linux/alpha/syscalls.list | 1 - sysdeps/unix/sysv/linux/arm/syscalls.list | 1 - sysdeps/unix/sysv/linux/generic/syscalls.list | 1 - sysdeps/unix/sysv/linux/hppa/syscalls.list | 1 - sysdeps/unix/sysv/linux/i386/kernel-features.h | 2 +- sysdeps/unix/sysv/linux/ia64/syscalls.list | 1 - 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/mips/syscalls.list | 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 | 2 +- sysdeps/unix/sysv/linux/sparc/sparc64/syscalls.list | 1 - sysdeps/unix/sysv/linux/x86_64/syscalls.list | 1 - 16 files changed, 5 insertions(+), 15 deletions(-) diff --git a/sysdeps/unix/sysv/linux/alpha/syscalls.list b/sysdeps/unix/sysv/linux/alpha/syscalls.list index 6509fd08df..419cf54427 100644 --- a/sysdeps/unix/sysv/linux/alpha/syscalls.list +++ b/sysdeps/unix/sysv/linux/alpha/syscalls.list @@ -5,7 +5,6 @@ sigstack - sigstack 2 sigstack getpriority - getpriority i:ii __getpriority getpriority # proper socket implementations: -shutdown - shutdown i:ii __shutdown shutdown socket - socket i:iii __socket socket socketpair - socketpair i:iiif __socketpair socketpair diff --git a/sysdeps/unix/sysv/linux/arm/syscalls.list b/sysdeps/unix/sysv/linux/arm/syscalls.list index ef2b3bbdfa..dce1f1ae95 100644 --- a/sysdeps/unix/sysv/linux/arm/syscalls.list +++ b/sysdeps/unix/sysv/linux/arm/syscalls.list @@ -20,6 +20,5 @@ prlimit64 EXTRA prlimit64 i:iipp prlimit64 fanotify_mark EXTRA fanotify_mark i:iiiiis fanotify_mark # proper socket implementations: -shutdown - shutdown i:ii __shutdown shutdown socket - socket i:iii __socket socket socketpair - socketpair i:iiif __socketpair socketpair diff --git a/sysdeps/unix/sysv/linux/generic/syscalls.list b/sysdeps/unix/sysv/linux/generic/syscalls.list index 9e42520f12..bcae3bc0d1 100644 --- a/sysdeps/unix/sysv/linux/generic/syscalls.list +++ b/sysdeps/unix/sysv/linux/generic/syscalls.list @@ -3,4 +3,3 @@ # Socket APIs socket - socket i:iii __socket socket socketpair - socketpair i:iiif __socketpair socketpair -shutdown - shutdown i:ii __shutdown shutdown diff --git a/sysdeps/unix/sysv/linux/hppa/syscalls.list b/sysdeps/unix/sysv/linux/hppa/syscalls.list index 247e1b5831..ab08a76d0c 100644 --- a/sysdeps/unix/sysv/linux/hppa/syscalls.list +++ b/sysdeps/unix/sysv/linux/hppa/syscalls.list @@ -1,7 +1,6 @@ # File name Caller Syscall name # args Strong name Weak names # proper socket implementations: -shutdown - shutdown i:ii __shutdown shutdown socket - socket i:iii __socket socket socketpair - socketpair i:iiif __socketpair socketpair diff --git a/sysdeps/unix/sysv/linux/i386/kernel-features.h b/sysdeps/unix/sysv/linux/i386/kernel-features.h index ccf81a2634..164d683713 100644 --- a/sysdeps/unix/sysv/linux/i386/kernel-features.h +++ b/sysdeps/unix/sysv/linux/i386/kernel-features.h @@ -21,7 +21,6 @@ #if __LINUX_KERNEL_VERSION >= 0x040300 # define __ASSUME_SOCKET_SYSCALL 1 # define __ASSUME_SOCKETPAIR_SYSCALL 1 -# define __ASSUME_SHUTDOWN_SYSCALL 1 #endif #include_next @@ -41,6 +40,7 @@ # undef __ASSUME_GETSOCKOPT_SYSCALL # undef __ASSUME_LISTEN_SYSCALL # undef __ASSUME_SETSOCKOPT_SYSCALL +# undef __ASSUME_SHUTDOWN_SYSCALL #endif /* i686 only supports ipc syscall before 5.1. */ diff --git a/sysdeps/unix/sysv/linux/ia64/syscalls.list b/sysdeps/unix/sysv/linux/ia64/syscalls.list index 3a3cfe5d2a..b5ad98aaae 100644 --- a/sysdeps/unix/sysv/linux/ia64/syscalls.list +++ b/sysdeps/unix/sysv/linux/ia64/syscalls.list @@ -3,7 +3,6 @@ getpriority - getpriority i:ii __getpriority getpriority # proper socket implementations: -shutdown - shutdown i:ii __shutdown shutdown socket - socket i:iii __socket socket socketpair - socketpair i:iiif __socketpair socketpair diff --git a/sysdeps/unix/sysv/linux/kernel-features.h b/sysdeps/unix/sysv/linux/kernel-features.h index fcf42866a5..04058111b8 100644 --- a/sysdeps/unix/sysv/linux/kernel-features.h +++ b/sysdeps/unix/sysv/linux/kernel-features.h @@ -83,6 +83,7 @@ #define __ASSUME_GETSOCKOPT_SYSCALL 1 #define __ASSUME_LISTEN_SYSCALL 1 #define __ASSUME_SETSOCKOPT_SYSCALL 1 +#define __ASSUME_SHUTDOWN_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 0db2aa8592..b119443ba6 100644 --- a/sysdeps/unix/sysv/linux/m68k/kernel-features.h +++ b/sysdeps/unix/sysv/linux/m68k/kernel-features.h @@ -21,7 +21,6 @@ #if __LINUX_KERNEL_VERSION >= 0x040300 # define __ASSUME_SOCKET_SYSCALL 1 # define __ASSUME_SOCKETPAIR_SYSCALL 1 -# define __ASSUME_SHUTDOWN_SYSCALL 1 #endif #include_next @@ -43,6 +42,7 @@ # undef __ASSUME_GETSOCKOPT_SYSCALL # undef __ASSUME_LISTEN_SYSCALL # undef __ASSUME_SETSOCKOPT_SYSCALL +# undef __ASSUME_SHUTDOWN_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 30aa9e7550..a2aaa82c4b 100644 --- a/sysdeps/unix/sysv/linux/microblaze/kernel-features.h +++ b/sysdeps/unix/sysv/linux/microblaze/kernel-features.h @@ -23,7 +23,6 @@ #define __ASSUME_SOCKETPAIR_SYSCALL 1 #define __ASSUME_SEND_SYSCALL 1 #define __ASSUME_RECV_SYSCALL 1 -#define __ASSUME_SHUTDOWN_SYSCALL 1 #include_next diff --git a/sysdeps/unix/sysv/linux/mips/syscalls.list b/sysdeps/unix/sysv/linux/mips/syscalls.list index 2d7a83d22f..fefe2f16ee 100644 --- a/sysdeps/unix/sysv/linux/mips/syscalls.list +++ b/sysdeps/unix/sysv/linux/mips/syscalls.list @@ -12,6 +12,5 @@ sysmips - sysmips i:iiii __sysmips sysmips # Socket functions; Linux/MIPS doesn't use the socketcall(2) wrapper; # it's provided for compatibility, though. # -shutdown - shutdown i:ii __shutdown shutdown socket - socket i:iii __socket socket socketpair - socketpair i:iiif __socketpair socketpair diff --git a/sysdeps/unix/sysv/linux/powerpc/kernel-features.h b/sysdeps/unix/sysv/linux/powerpc/kernel-features.h index f6d4135358..a748d44abc 100644 --- a/sysdeps/unix/sysv/linux/powerpc/kernel-features.h +++ b/sysdeps/unix/sysv/linux/powerpc/kernel-features.h @@ -23,7 +23,6 @@ #define __ASSUME_SOCKETPAIR_SYSCALL 1 #define __ASSUME_SEND_SYSCALL 1 #define __ASSUME_RECV_SYSCALL 1 -#define __ASSUME_SHUTDOWN_SYSCALL 1 /* Define this if your 32-bit syscall API requires 64-bit register pairs to start with an even-number register. */ diff --git a/sysdeps/unix/sysv/linux/s390/kernel-features.h b/sysdeps/unix/sysv/linux/s390/kernel-features.h index 0dfe56e536..619bc3f0d2 100644 --- a/sysdeps/unix/sysv/linux/s390/kernel-features.h +++ b/sysdeps/unix/sysv/linux/s390/kernel-features.h @@ -21,7 +21,6 @@ #if __LINUX_KERNEL_VERSION >= 0x040300 # define __ASSUME_SOCKET_SYSCALL 1 # define __ASSUME_SOCKETPAIR_SYSCALL 1 -# define __ASSUME_SHUTDOWN_SYSCALL 1 #endif #include_next @@ -42,6 +41,7 @@ # undef __ASSUME_GETSOCKOPT_SYSCALL # undef __ASSUME_LISTEN_SYSCALL # undef __ASSUME_SETSOCKOPT_SYSCALL +# undef __ASSUME_SHUTDOWN_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 b36000df4c..e42c71a84a 100644 --- a/sysdeps/unix/sysv/linux/sh/kernel-features.h +++ b/sysdeps/unix/sysv/linux/sh/kernel-features.h @@ -28,7 +28,6 @@ #define __ASSUME_SOCKETPAIR_SYSCALL 1 #define __ASSUME_SEND_SYSCALL 1 #define __ASSUME_RECV_SYSCALL 1 -#define __ASSUME_SHUTDOWN_SYSCALL 1 #include_next diff --git a/sysdeps/unix/sysv/linux/sparc/kernel-features.h b/sysdeps/unix/sysv/linux/sparc/kernel-features.h index 430d6503cb..acca2a09bc 100644 --- a/sysdeps/unix/sysv/linux/sparc/kernel-features.h +++ b/sysdeps/unix/sysv/linux/sparc/kernel-features.h @@ -39,10 +39,10 @@ # undef __ASSUME_RECVFROM_SYSCALL # undef __ASSUME_SENDTO_SYSCALL # undef __ASSUME_GETSOCKOPT_SYSCALL +# undef __ASSUME_SHUTDOWN_SYSCALL #else # define __ASSUME_SOCKET_SYSCALL 1 # define __ASSUME_SOCKETPAIR_SYSCALL 1 -# define __ASSUME_SHUTDOWN_SYSCALL 1 #endif /* These syscalls were added for both 32-bit and 64-bit in 4.4. */ diff --git a/sysdeps/unix/sysv/linux/sparc/sparc64/syscalls.list b/sysdeps/unix/sysv/linux/sparc/sparc64/syscalls.list index 0f878a2f3f..94c081f804 100644 --- a/sysdeps/unix/sysv/linux/sparc/sparc64/syscalls.list +++ b/sysdeps/unix/sysv/linux/sparc/sparc64/syscalls.list @@ -1,4 +1,3 @@ # File name Caller Syscall name # args Strong name Weak names -shutdown - shutdown 2 __shutdown shutdown socketpair - socketpair 4 __socketpair socketpair diff --git a/sysdeps/unix/sysv/linux/x86_64/syscalls.list b/sysdeps/unix/sysv/linux/x86_64/syscalls.list index 8463099365..cb2939ed74 100644 --- a/sysdeps/unix/sysv/linux/x86_64/syscalls.list +++ b/sysdeps/unix/sysv/linux/x86_64/syscalls.list @@ -6,6 +6,5 @@ syscall_clock_gettime EXTRA clock_gettime Ei:ip __syscall_clock_gettime # proper socket implementations: -shutdown - shutdown i:ii __shutdown shutdown socket - socket i:iii __socket socket socketpair - socketpair i:iiif __socketpair socketpair From patchwork Wed Nov 18 19:55:38 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adhemerval Zanella Netto X-Patchwork-Id: 41116 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 376183946C32; Wed, 18 Nov 2020 19:56:29 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 376183946C32 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1605729389; bh=N/SaBXg793vTfIejrwA8eWugakn/8n7mB4Imu7oDSQU=; h=To:Subject:Date:In-Reply-To:References:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=ui2qSuodeJmUG6Frs2L9VY9xYffKf3IsYokprjrq2Lxt7MRSSFe+bcOsp4rvYNT/p +sXfZpOhUefrdgijZYJKLkxEbwvuxaspVtrtyR/9M+zgf7wqp5Cijh9Q5wTUL+JwsF VSN+EYlT0MIR1Hs4XEQVEG1Z9kooRFNDFdjwZjgQ= X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from mail-qv1-xf44.google.com (mail-qv1-xf44.google.com [IPv6:2607:f8b0:4864:20::f44]) by sourceware.org (Postfix) with ESMTPS id 9FE1F39450C4 for ; Wed, 18 Nov 2020 19:56:18 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 9FE1F39450C4 Received: by mail-qv1-xf44.google.com with SMTP id y11so1652183qvu.10 for ; Wed, 18 Nov 2020 11:56:18 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=N/SaBXg793vTfIejrwA8eWugakn/8n7mB4Imu7oDSQU=; b=oCrWXDKu57q8hPYGvfDf8+Dzc+etA8CjVvEp7pLXa6EUM8Y4vUq4sTxZGBOptWxyWh FS2mfloGP3qxnANnU8b3xAFn+DVzy33hvcSmSELH219RUVO5cjP8uxTdDshiCO1wea8z AYKQbf006YwxeXYmeN5D3sUflMCCcsVlXGD9LY0huSXF/G4pyF4B6l0G2Ji98UVO0v3g 0eBI/BhZ9zqe/++fNfbviY6HLbQvdqBTNMmJ+q+/WyTCCmE0ksER1X68c8Gxxk1bD/Jw KmRTT4Sag79QCEfcKFwgUN53jEt262k+k5GDdEgUD/brVw8e1K6d1tG2Tw+zV2w9o/Ac 6p5g== X-Gm-Message-State: AOAM530SyD2ODRlVt6SiAWalfeZqerEhmE7oOZ5rCWzWsXyduQnrZSVN yfy12xMO6R7pjH9vO76sIkGxUd4KSeE7Rw== X-Google-Smtp-Source: ABdhPJxIH0ItXLgb21H3IKvP+XkysZYwlhJpcoY5HFtD0j3nrvzi3qqdZPAevivnM66G02Y6WdHjvQ== X-Received: by 2002:a05:6214:c8d:: with SMTP id r13mr6486455qvr.3.1605729377823; Wed, 18 Nov 2020 11:56:17 -0800 (PST) Received: from localhost.localdomain ([177.194.48.209]) by smtp.googlemail.com with ESMTPSA id f27sm6538775qtv.95.2020.11.18.11.56.16 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 18 Nov 2020 11:56:17 -0800 (PST) To: libc-alpha@sourceware.org Subject: [PATCH 14/28] linux: Assume socket support Date: Wed, 18 Nov 2020 16:55:38 -0300 Message-Id: <20201118195552.2687336-15-adhemerval.zanella@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20201118195552.2687336-1-adhemerval.zanella@linaro.org> References: <20201118195552.2687336-1-adhemerval.zanella@linaro.org> MIME-Version: 1.0 X-Spam-Status: No, score=-13.9 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, KAM_SHORT, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Adhemerval Zanella via Libc-alpha From: Adhemerval Zanella Netto Reply-To: Adhemerval Zanella Errors-To: libc-alpha-bounces@sourceware.org Sender: "Libc-alpha" Checked with build for the affected ABI. --- sysdeps/unix/sysv/linux/alpha/syscalls.list | 1 - sysdeps/unix/sysv/linux/arm/syscalls.list | 1 - sysdeps/unix/sysv/linux/generic/syscalls.list | 1 - sysdeps/unix/sysv/linux/hppa/syscalls.list | 1 - sysdeps/unix/sysv/linux/i386/kernel-features.h | 2 +- sysdeps/unix/sysv/linux/ia64/syscalls.list | 1 - 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/mips/syscalls.list | 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 | 2 +- sysdeps/unix/sysv/linux/x86_64/syscalls.list | 1 - 15 files changed, 5 insertions(+), 14 deletions(-) diff --git a/sysdeps/unix/sysv/linux/alpha/syscalls.list b/sysdeps/unix/sysv/linux/alpha/syscalls.list index 419cf54427..b35f5fc199 100644 --- a/sysdeps/unix/sysv/linux/alpha/syscalls.list +++ b/sysdeps/unix/sysv/linux/alpha/syscalls.list @@ -5,7 +5,6 @@ sigstack - sigstack 2 sigstack getpriority - getpriority i:ii __getpriority getpriority # proper socket implementations: -socket - socket i:iii __socket socket socketpair - socketpair i:iiif __socketpair socketpair ptrace - ptrace 4 __ptrace ptrace diff --git a/sysdeps/unix/sysv/linux/arm/syscalls.list b/sysdeps/unix/sysv/linux/arm/syscalls.list index dce1f1ae95..1dec4bcfdd 100644 --- a/sysdeps/unix/sysv/linux/arm/syscalls.list +++ b/sysdeps/unix/sysv/linux/arm/syscalls.list @@ -20,5 +20,4 @@ prlimit64 EXTRA prlimit64 i:iipp prlimit64 fanotify_mark EXTRA fanotify_mark i:iiiiis fanotify_mark # proper socket implementations: -socket - socket i:iii __socket socket socketpair - socketpair i:iiif __socketpair socketpair diff --git a/sysdeps/unix/sysv/linux/generic/syscalls.list b/sysdeps/unix/sysv/linux/generic/syscalls.list index bcae3bc0d1..0749707049 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 -socket - socket i:iii __socket socket socketpair - socketpair i:iiif __socketpair socketpair diff --git a/sysdeps/unix/sysv/linux/hppa/syscalls.list b/sysdeps/unix/sysv/linux/hppa/syscalls.list index ab08a76d0c..4a159a4da5 100644 --- a/sysdeps/unix/sysv/linux/hppa/syscalls.list +++ b/sysdeps/unix/sysv/linux/hppa/syscalls.list @@ -1,7 +1,6 @@ # File name Caller Syscall name # args Strong name Weak names # proper socket implementations: -socket - socket i:iii __socket socket socketpair - socketpair i:iiif __socketpair socketpair prlimit64 EXTRA prlimit64 i:iipp __prlimit64 prlimit64@@GLIBC_2.17 diff --git a/sysdeps/unix/sysv/linux/i386/kernel-features.h b/sysdeps/unix/sysv/linux/i386/kernel-features.h index 164d683713..e15db22472 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_SOCKET_SYSCALL 1 # define __ASSUME_SOCKETPAIR_SYSCALL 1 #endif @@ -41,6 +40,7 @@ # undef __ASSUME_LISTEN_SYSCALL # undef __ASSUME_SETSOCKOPT_SYSCALL # undef __ASSUME_SHUTDOWN_SYSCALL +# undef __ASSUME_SOCKET_SYSCALL #endif /* i686 only supports ipc syscall before 5.1. */ diff --git a/sysdeps/unix/sysv/linux/ia64/syscalls.list b/sysdeps/unix/sysv/linux/ia64/syscalls.list index b5ad98aaae..33cc01b64a 100644 --- a/sysdeps/unix/sysv/linux/ia64/syscalls.list +++ b/sysdeps/unix/sysv/linux/ia64/syscalls.list @@ -3,7 +3,6 @@ getpriority - getpriority i:ii __getpriority getpriority # proper socket implementations: -socket - socket i:iii __socket socket socketpair - socketpair i:iiif __socketpair socketpair # DIG-compliant access to PCI configuration space: diff --git a/sysdeps/unix/sysv/linux/kernel-features.h b/sysdeps/unix/sysv/linux/kernel-features.h index 04058111b8..6d5658c680 100644 --- a/sysdeps/unix/sysv/linux/kernel-features.h +++ b/sysdeps/unix/sysv/linux/kernel-features.h @@ -84,6 +84,7 @@ #define __ASSUME_LISTEN_SYSCALL 1 #define __ASSUME_SETSOCKOPT_SYSCALL 1 #define __ASSUME_SHUTDOWN_SYSCALL 1 +#define __ASSUME_SOCKET_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 b119443ba6..b9371c36b0 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_SOCKET_SYSCALL 1 # define __ASSUME_SOCKETPAIR_SYSCALL 1 #endif @@ -43,6 +42,7 @@ # undef __ASSUME_LISTEN_SYSCALL # undef __ASSUME_SETSOCKOPT_SYSCALL # undef __ASSUME_SHUTDOWN_SYSCALL +# undef __ASSUME_SOCKET_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 a2aaa82c4b..3082a05426 100644 --- a/sysdeps/unix/sysv/linux/microblaze/kernel-features.h +++ b/sysdeps/unix/sysv/linux/microblaze/kernel-features.h @@ -18,7 +18,6 @@ #include /* All supported kernel versions for MicroBlaze have these syscalls. */ -#define __ASSUME_SOCKET_SYSCALL 1 #define __ASSUME_CONNECT_SYSCALL 1 #define __ASSUME_SOCKETPAIR_SYSCALL 1 #define __ASSUME_SEND_SYSCALL 1 diff --git a/sysdeps/unix/sysv/linux/mips/syscalls.list b/sysdeps/unix/sysv/linux/mips/syscalls.list index fefe2f16ee..9881c832a5 100644 --- a/sysdeps/unix/sysv/linux/mips/syscalls.list +++ b/sysdeps/unix/sysv/linux/mips/syscalls.list @@ -12,5 +12,4 @@ sysmips - sysmips i:iiii __sysmips sysmips # Socket functions; Linux/MIPS doesn't use the socketcall(2) wrapper; # it's provided for compatibility, though. # -socket - socket i:iii __socket socket socketpair - socketpair i:iiif __socketpair socketpair diff --git a/sysdeps/unix/sysv/linux/powerpc/kernel-features.h b/sysdeps/unix/sysv/linux/powerpc/kernel-features.h index a748d44abc..e50a0a5069 100644 --- a/sysdeps/unix/sysv/linux/powerpc/kernel-features.h +++ b/sysdeps/unix/sysv/linux/powerpc/kernel-features.h @@ -18,7 +18,6 @@ . */ /* New syscalls added for PowerPC in 2.6.37. */ -#define __ASSUME_SOCKET_SYSCALL 1 #define __ASSUME_CONNECT_SYSCALL 1 #define __ASSUME_SOCKETPAIR_SYSCALL 1 #define __ASSUME_SEND_SYSCALL 1 diff --git a/sysdeps/unix/sysv/linux/s390/kernel-features.h b/sysdeps/unix/sysv/linux/s390/kernel-features.h index 619bc3f0d2..a74f8af97d 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_SOCKET_SYSCALL 1 # define __ASSUME_SOCKETPAIR_SYSCALL 1 #endif @@ -42,6 +41,7 @@ # undef __ASSUME_LISTEN_SYSCALL # undef __ASSUME_SETSOCKOPT_SYSCALL # undef __ASSUME_SHUTDOWN_SYSCALL +# undef __ASSUME_SOCKET_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 e42c71a84a..9aecddc1b3 100644 --- a/sysdeps/unix/sysv/linux/sh/kernel-features.h +++ b/sysdeps/unix/sysv/linux/sh/kernel-features.h @@ -23,7 +23,6 @@ #include /* These syscalls were added for SH in 2.6.37. */ -#define __ASSUME_SOCKET_SYSCALL 1 #define __ASSUME_CONNECT_SYSCALL 1 #define __ASSUME_SOCKETPAIR_SYSCALL 1 #define __ASSUME_SEND_SYSCALL 1 diff --git a/sysdeps/unix/sysv/linux/sparc/kernel-features.h b/sysdeps/unix/sysv/linux/sparc/kernel-features.h index acca2a09bc..54e79852e6 100644 --- a/sysdeps/unix/sysv/linux/sparc/kernel-features.h +++ b/sysdeps/unix/sysv/linux/sparc/kernel-features.h @@ -40,8 +40,8 @@ # undef __ASSUME_SENDTO_SYSCALL # undef __ASSUME_GETSOCKOPT_SYSCALL # undef __ASSUME_SHUTDOWN_SYSCALL +# undef __ASSUME_SOCKET_SYSCALL #else -# define __ASSUME_SOCKET_SYSCALL 1 # define __ASSUME_SOCKETPAIR_SYSCALL 1 #endif diff --git a/sysdeps/unix/sysv/linux/x86_64/syscalls.list b/sysdeps/unix/sysv/linux/x86_64/syscalls.list index cb2939ed74..447f653cc0 100644 --- a/sysdeps/unix/sysv/linux/x86_64/syscalls.list +++ b/sysdeps/unix/sysv/linux/x86_64/syscalls.list @@ -6,5 +6,4 @@ syscall_clock_gettime EXTRA clock_gettime Ei:ip __syscall_clock_gettime # proper socket implementations: -socket - socket i:iii __socket socket socketpair - socketpair i:iiif __socketpair socketpair From patchwork Wed Nov 18 19:55:39 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adhemerval Zanella Netto X-Patchwork-Id: 41113 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 0C90E39450FB; Wed, 18 Nov 2020 19:56:27 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 0C90E39450FB DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1605729387; bh=PDySnGZCRhBuz8D64hJ8aGxCQ2pcEuDbguGTURdSjiA=; h=To:Subject:Date:In-Reply-To:References:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=d5yYUBLqLom/eas/+tvK6ug3Z88EOuy7LlOsV9S2zTKXUGj84biLtB/ihTUybIVac 52+LJ7+FuePEXpxUYF2B8cB94kUTppNw81D6wBpj1eGtLXqXkkwIqqxBR/OJx105C7 /K+xqeMpHfbbgHq9CcR+N43ECscrZsJadqqnSvU4= X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from mail-qv1-xf43.google.com (mail-qv1-xf43.google.com [IPv6:2607:f8b0:4864:20::f43]) by sourceware.org (Postfix) with ESMTPS id 2624E39450D3 for ; Wed, 18 Nov 2020 19:56:20 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 2624E39450D3 Received: by mail-qv1-xf43.google.com with SMTP id r12so1635207qvq.13 for ; Wed, 18 Nov 2020 11:56:20 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=PDySnGZCRhBuz8D64hJ8aGxCQ2pcEuDbguGTURdSjiA=; b=ZL81elGjTBqSK0hLzZJWtxqA66EaM+/Bvq/602vjlxMydF9aqASYlVrLLb+dWF3iW5 e+ExqMwK2w7soJOdcDajbeR/No4IlczBLmpAWq9P2k7AAwaWHVr0lluXXFMdL4Hk9dCa 7j0VB1OWwL3d55bBgH7UVvncI/PXkbBZXb8+Vfb6JkNfJKzi4tS74jPPQDDQcA6AkpV+ diHBXtaIWYQA95h6ilHxqiscBfBh4GTt6MJbyRMmQVf9W4HIaqOudXN+n9rVV1RXpaou dGeJvgnggCVzST9Nlivddlo7Ue975ymfEntHHcYOs3qDtbQNI0aZIx95CsUB6Yy/oJT/ nyYQ== X-Gm-Message-State: AOAM530lgAmDExU+X0ZUmELVOszAibrKO3NP8AmN4gSRKtuNPn+WL6PX Qv+1j5F44nf8AIeNfCMvopINFE+8vlLlaQ== X-Google-Smtp-Source: ABdhPJysQQ3G3pzwMbZzndeij1qj7lllEZHAnnXGzlnI9Q1RHNscbzPZzSFDSiW29Xv38fnHpTyVJw== X-Received: by 2002:ad4:57a6:: with SMTP id g6mr6023893qvx.27.1605729379253; Wed, 18 Nov 2020 11:56:19 -0800 (PST) Received: from localhost.localdomain ([177.194.48.209]) by smtp.googlemail.com with ESMTPSA id f27sm6538775qtv.95.2020.11.18.11.56.18 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 18 Nov 2020 11:56:18 -0800 (PST) To: libc-alpha@sourceware.org Subject: [PATCH 15/28] linux: Assume socketpair support Date: Wed, 18 Nov 2020 16:55:39 -0300 Message-Id: <20201118195552.2687336-16-adhemerval.zanella@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20201118195552.2687336-1-adhemerval.zanella@linaro.org> References: <20201118195552.2687336-1-adhemerval.zanella@linaro.org> MIME-Version: 1.0 X-Spam-Status: No, score=-13.9 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, KAM_SHORT, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Adhemerval Zanella via Libc-alpha From: Adhemerval Zanella Netto Reply-To: Adhemerval Zanella Errors-To: libc-alpha-bounces@sourceware.org Sender: "Libc-alpha" Checked with build for the affected ABI. --- sysdeps/unix/sysv/linux/alpha/syscalls.list | 3 --- sysdeps/unix/sysv/linux/arm/syscalls.list | 3 --- sysdeps/unix/sysv/linux/generic/syscalls.list | 4 ---- sysdeps/unix/sysv/linux/hppa/syscalls.list | 3 --- sysdeps/unix/sysv/linux/i386/kernel-features.h | 7 ++----- sysdeps/unix/sysv/linux/ia64/syscalls.list | 3 --- sysdeps/unix/sysv/linux/kernel-features.h | 1 + sysdeps/unix/sysv/linux/m68k/kernel-features.h | 7 ++----- sysdeps/unix/sysv/linux/microblaze/kernel-features.h | 1 - sysdeps/unix/sysv/linux/mips/syscalls.list | 6 ------ sysdeps/unix/sysv/linux/powerpc/kernel-features.h | 1 - sysdeps/unix/sysv/linux/s390/kernel-features.h | 7 ++----- sysdeps/unix/sysv/linux/sh/kernel-features.h | 1 - sysdeps/unix/sysv/linux/sparc/kernel-features.h | 3 +-- sysdeps/unix/sysv/linux/sparc/sparc64/syscalls.list | 3 --- sysdeps/unix/sysv/linux/x86_64/syscalls.list | 4 ---- 16 files changed, 8 insertions(+), 49 deletions(-) delete mode 100644 sysdeps/unix/sysv/linux/generic/syscalls.list delete mode 100644 sysdeps/unix/sysv/linux/sparc/sparc64/syscalls.list diff --git a/sysdeps/unix/sysv/linux/alpha/syscalls.list b/sysdeps/unix/sysv/linux/alpha/syscalls.list index b35f5fc199..6e06255d3c 100644 --- a/sysdeps/unix/sysv/linux/alpha/syscalls.list +++ b/sysdeps/unix/sysv/linux/alpha/syscalls.list @@ -4,9 +4,6 @@ sigstack - sigstack 2 sigstack getpriority - getpriority i:ii __getpriority getpriority -# proper socket implementations: -socketpair - socketpair i:iiif __socketpair socketpair - ptrace - ptrace 4 __ptrace ptrace # access pci space protected from machine checks: diff --git a/sysdeps/unix/sysv/linux/arm/syscalls.list b/sysdeps/unix/sysv/linux/arm/syscalls.list index 1dec4bcfdd..742ed64ec9 100644 --- a/sysdeps/unix/sysv/linux/arm/syscalls.list +++ b/sysdeps/unix/sysv/linux/arm/syscalls.list @@ -18,6 +18,3 @@ setfsuid - setfsuid32 Ei:i setfsuid prlimit64 EXTRA prlimit64 i:iipp prlimit64 fanotify_mark EXTRA fanotify_mark i:iiiiis fanotify_mark - -# proper socket implementations: -socketpair - socketpair i:iiif __socketpair socketpair diff --git a/sysdeps/unix/sysv/linux/generic/syscalls.list b/sysdeps/unix/sysv/linux/generic/syscalls.list deleted file mode 100644 index 0749707049..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 -socketpair - socketpair i:iiif __socketpair socketpair diff --git a/sysdeps/unix/sysv/linux/hppa/syscalls.list b/sysdeps/unix/sysv/linux/hppa/syscalls.list index 4a159a4da5..11fada447c 100644 --- a/sysdeps/unix/sysv/linux/hppa/syscalls.list +++ b/sysdeps/unix/sysv/linux/hppa/syscalls.list @@ -1,7 +1,4 @@ # File name Caller Syscall name # args Strong name Weak names -# proper socket implementations: -socketpair - socketpair i:iiif __socketpair socketpair - prlimit64 EXTRA prlimit64 i:iipp __prlimit64 prlimit64@@GLIBC_2.17 fanotify_mark EXTRA fanotify_mark i:iiiiis __fanotify_mark fanotify_mark@@GLIBC_2.19 diff --git a/sysdeps/unix/sysv/linux/i386/kernel-features.h b/sysdeps/unix/sysv/linux/i386/kernel-features.h index e15db22472..176552766e 100644 --- a/sysdeps/unix/sysv/linux/i386/kernel-features.h +++ b/sysdeps/unix/sysv/linux/i386/kernel-features.h @@ -17,15 +17,11 @@ License along with the GNU C Library; if not, see . */ -/* Direct socketcalls available with kernel 4.3. */ -#if __LINUX_KERNEL_VERSION >= 0x040300 -# define __ASSUME_SOCKETPAIR_SYSCALL 1 -#endif - #include_next #undef __ASSUME_ACCEPT_SYSCALL +/* Direct socketcalls available with kernel 4.3. */ #if __LINUX_KERNEL_VERSION < 0x040300 # undef __ASSUME_BIND_SYSCALL # undef __ASSUME_ACCEPT4_SYSCALL @@ -41,6 +37,7 @@ # undef __ASSUME_SETSOCKOPT_SYSCALL # undef __ASSUME_SHUTDOWN_SYSCALL # undef __ASSUME_SOCKET_SYSCALL +# undef __ASSUME_SOCKETPAIR_SYSCALL #endif /* i686 only supports ipc syscall before 5.1. */ diff --git a/sysdeps/unix/sysv/linux/ia64/syscalls.list b/sysdeps/unix/sysv/linux/ia64/syscalls.list index 33cc01b64a..e468da4816 100644 --- a/sysdeps/unix/sysv/linux/ia64/syscalls.list +++ b/sysdeps/unix/sysv/linux/ia64/syscalls.list @@ -2,9 +2,6 @@ getpriority - getpriority i:ii __getpriority getpriority -# proper socket implementations: -socketpair - socketpair i:iiif __socketpair socketpair - # DIG-compliant access to PCI configuration space: pciconfig_read EXTRA pciconfig_read 5 pciconfig_read pciconfig_write EXTRA pciconfig_write 5 pciconfig_write diff --git a/sysdeps/unix/sysv/linux/kernel-features.h b/sysdeps/unix/sysv/linux/kernel-features.h index 6d5658c680..b7c1996943 100644 --- a/sysdeps/unix/sysv/linux/kernel-features.h +++ b/sysdeps/unix/sysv/linux/kernel-features.h @@ -85,6 +85,7 @@ #define __ASSUME_SETSOCKOPT_SYSCALL 1 #define __ASSUME_SHUTDOWN_SYSCALL 1 #define __ASSUME_SOCKET_SYSCALL 1 +#define __ASSUME_SOCKETPAIR_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 b9371c36b0..ed7954f09a 100644 --- a/sysdeps/unix/sysv/linux/m68k/kernel-features.h +++ b/sysdeps/unix/sysv/linux/m68k/kernel-features.h @@ -17,15 +17,11 @@ License along with the GNU C Library. If not, see . */ -/* Direct socketcalls available with kernel 4.3. */ -#if __LINUX_KERNEL_VERSION >= 0x040300 -# define __ASSUME_SOCKETPAIR_SYSCALL 1 -#endif - #include_next #undef __ASSUME_ACCEPT_SYSCALL +/* Direct socketcalls available with kernel 4.3. */ #if __LINUX_KERNEL_VERSION < 0x040300 # undef __ASSUME_BIND_SYSCALL # undef __ASSUME_ACCEPT4_SYSCALL @@ -43,6 +39,7 @@ # undef __ASSUME_SETSOCKOPT_SYSCALL # undef __ASSUME_SHUTDOWN_SYSCALL # undef __ASSUME_SOCKET_SYSCALL +# undef __ASSUME_SOCKETPAIR_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 3082a05426..ede5e8d359 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_SOCKETPAIR_SYSCALL 1 #define __ASSUME_SEND_SYSCALL 1 #define __ASSUME_RECV_SYSCALL 1 diff --git a/sysdeps/unix/sysv/linux/mips/syscalls.list b/sysdeps/unix/sysv/linux/mips/syscalls.list index 9881c832a5..4b72434b57 100644 --- a/sysdeps/unix/sysv/linux/mips/syscalls.list +++ b/sysdeps/unix/sysv/linux/mips/syscalls.list @@ -7,9 +7,3 @@ cachectl - cachectl i:pii __cachectl cachectl cacheflush - cacheflush i:pii _flush_cache cacheflush sysmips - sysmips i:iiii __sysmips sysmips - -# -# Socket functions; Linux/MIPS doesn't use the socketcall(2) wrapper; -# it's provided for compatibility, though. -# -socketpair - socketpair i:iiif __socketpair socketpair diff --git a/sysdeps/unix/sysv/linux/powerpc/kernel-features.h b/sysdeps/unix/sysv/linux/powerpc/kernel-features.h index e50a0a5069..7397a844cf 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_SOCKETPAIR_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 a74f8af97d..2b3e162ad7 100644 --- a/sysdeps/unix/sysv/linux/s390/kernel-features.h +++ b/sysdeps/unix/sysv/linux/s390/kernel-features.h @@ -17,15 +17,11 @@ License along with the GNU C Library; if not, see . */ -/* Direct socketcalls available with kernel 4.3. */ -#if __LINUX_KERNEL_VERSION >= 0x040300 -# define __ASSUME_SOCKETPAIR_SYSCALL 1 -#endif - #include_next #undef __ASSUME_ACCEPT_SYSCALL +/* Direct socketcalls available with kernel 4.3. */ #if __LINUX_KERNEL_VERSION < 0x040300 # undef __ASSUME_BIND_SYSCALL # undef __ASSUME_ACCEPT4_SYSCALL @@ -42,6 +38,7 @@ # undef __ASSUME_SETSOCKOPT_SYSCALL # undef __ASSUME_SHUTDOWN_SYSCALL # undef __ASSUME_SOCKET_SYSCALL +# undef __ASSUME_SOCKETPAIR_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 9aecddc1b3..ae0e3be10d 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_SOCKETPAIR_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 54e79852e6..3ebd4cea85 100644 --- a/sysdeps/unix/sysv/linux/sparc/kernel-features.h +++ b/sysdeps/unix/sysv/linux/sparc/kernel-features.h @@ -41,8 +41,7 @@ # undef __ASSUME_GETSOCKOPT_SYSCALL # undef __ASSUME_SHUTDOWN_SYSCALL # undef __ASSUME_SOCKET_SYSCALL -#else -# define __ASSUME_SOCKETPAIR_SYSCALL 1 +# undef __ASSUME_SOCKETPAIR_SYSCALL #endif /* These syscalls were added for both 32-bit and 64-bit in 4.4. */ diff --git a/sysdeps/unix/sysv/linux/sparc/sparc64/syscalls.list b/sysdeps/unix/sysv/linux/sparc/sparc64/syscalls.list deleted file mode 100644 index 94c081f804..0000000000 --- a/sysdeps/unix/sysv/linux/sparc/sparc64/syscalls.list +++ /dev/null @@ -1,3 +0,0 @@ -# File name Caller Syscall name # args Strong name Weak names - -socketpair - socketpair 4 __socketpair socketpair diff --git a/sysdeps/unix/sysv/linux/x86_64/syscalls.list b/sysdeps/unix/sysv/linux/x86_64/syscalls.list index 447f653cc0..2f7047be42 100644 --- a/sysdeps/unix/sysv/linux/x86_64/syscalls.list +++ b/sysdeps/unix/sysv/linux/x86_64/syscalls.list @@ -3,7 +3,3 @@ arch_prctl EXTRA arch_prctl i:ii __arch_prctl arch_prctl modify_ldt EXTRA modify_ldt i:ipi __modify_ldt modify_ldt syscall_clock_gettime EXTRA clock_gettime Ei:ip __syscall_clock_gettime - - -# proper socket implementations: -socketpair - socketpair i:iiif __socketpair socketpair From patchwork Wed Nov 18 19:55:40 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adhemerval Zanella Netto X-Patchwork-Id: 41114 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 1F2923945C14; Wed, 18 Nov 2020 19:56:28 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 1F2923945C14 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1605729388; bh=2X6jvjN0jXop/SBMsl5ninsoFzNxMUVyMFhvxEX+N4E=; h=To:Subject:Date:In-Reply-To:References:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=v9VElIOu+xueu5tdDFSD/Rc5jojVEFvGaOPAplKSr+LJ3hdAWvkJJTbfZRTrhMtqS 4/hv8ShDf/Z1ZUMa5oJqV3wnlJ+OCca2JTE4Bw+80tBZiU200a42eVNZLlTEF77rhE OSzohQUvPQKKqFQcGA9C3fINDlCrcQHuH1vJKZQI= X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from mail-qv1-xf43.google.com (mail-qv1-xf43.google.com [IPv6:2607:f8b0:4864:20::f43]) by sourceware.org (Postfix) with ESMTPS id 619F63944414 for ; Wed, 18 Nov 2020 19:56:21 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 619F63944414 Received: by mail-qv1-xf43.google.com with SMTP id ek7so1666790qvb.6 for ; Wed, 18 Nov 2020 11:56:21 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=2X6jvjN0jXop/SBMsl5ninsoFzNxMUVyMFhvxEX+N4E=; b=CEObW5swpJBQ1CiWHyDMePqYW0IP/2YN94uMacHn5tuIaM6HBQ9PtbTSBAhnN2pGpu Fsv/DCLReWtttMsuQOoVzeJrjV27pxIS4IbPMFbJKnnJZtFrnVXzNC0GEAnCVVB5F1hO rIGlRSiTL0POOFpB9HtrM3V9NcyLDYWgNgPuU+ag3O3bxsc3lzKXivMyXdpeLMOZ6uFW m+x2ZW/t74UqizM8NqLFbxxR+C1LBUu4oh6p7cOutgkMckLg5dLVY8eFWgEf3swP/2jI fvaNMAxDow9l+gBWLCuGgzvG1jAfh2Ixkb0xt38XOICXuWqdZ/Oi3iBm2D8eTomfmoag jgyQ== X-Gm-Message-State: AOAM530HCQyknz2Ji4l+beIZ9cqm7rIrTyZb1Mk7ZhFX2ovgDz9Ev3a1 s0KLjAnEgsChCuLB1ebg5D5Ozgc7ppAGZw== X-Google-Smtp-Source: ABdhPJzO/W4i5D4C2eabYvpQ8wVXIEJ2+UScO3wdcOP4miqthO2zj8rfdeUg7bsNvGUxOQLQYr3Sog== X-Received: by 2002:ad4:470d:: with SMTP id k13mr6730383qvz.40.1605729380791; Wed, 18 Nov 2020 11:56:20 -0800 (PST) Received: from localhost.localdomain ([177.194.48.209]) by smtp.googlemail.com with ESMTPSA id f27sm6538775qtv.95.2020.11.18.11.56.19 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 18 Nov 2020 11:56:20 -0800 (PST) To: libc-alpha@sourceware.org Subject: [PATCH 16/28] linux: Remove superflous __ASSUME_CONNECT_SYSCALL definitions Date: Wed, 18 Nov 2020 16:55:40 -0300 Message-Id: <20201118195552.2687336-17-adhemerval.zanella@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20201118195552.2687336-1-adhemerval.zanella@linaro.org> References: <20201118195552.2687336-1-adhemerval.zanella@linaro.org> MIME-Version: 1.0 X-Spam-Status: No, score=-13.9 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, KAM_SHORT, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Adhemerval Zanella via Libc-alpha From: Adhemerval Zanella Netto Reply-To: Adhemerval Zanella Errors-To: libc-alpha-bounces@sourceware.org Sender: "Libc-alpha" They are already set in Linux generic kernel-features.h. Checked with build for the affected ABI. --- sysdeps/unix/sysv/linux/microblaze/kernel-features.h | 1 - sysdeps/unix/sysv/linux/powerpc/kernel-features.h | 1 - sysdeps/unix/sysv/linux/sh/kernel-features.h | 1 - 3 files changed, 3 deletions(-) diff --git a/sysdeps/unix/sysv/linux/microblaze/kernel-features.h b/sysdeps/unix/sysv/linux/microblaze/kernel-features.h index ede5e8d359..583f8e3ca5 100644 --- a/sysdeps/unix/sysv/linux/microblaze/kernel-features.h +++ b/sysdeps/unix/sysv/linux/microblaze/kernel-features.h @@ -18,7 +18,6 @@ #include /* All supported kernel versions for MicroBlaze have these syscalls. */ -#define __ASSUME_CONNECT_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 7397a844cf..269667b3d8 100644 --- a/sysdeps/unix/sysv/linux/powerpc/kernel-features.h +++ b/sysdeps/unix/sysv/linux/powerpc/kernel-features.h @@ -18,7 +18,6 @@ . */ /* New syscalls added for PowerPC in 2.6.37. */ -#define __ASSUME_CONNECT_SYSCALL 1 #define __ASSUME_SEND_SYSCALL 1 #define __ASSUME_RECV_SYSCALL 1 diff --git a/sysdeps/unix/sysv/linux/sh/kernel-features.h b/sysdeps/unix/sysv/linux/sh/kernel-features.h index ae0e3be10d..ead988b54f 100644 --- a/sysdeps/unix/sysv/linux/sh/kernel-features.h +++ b/sysdeps/unix/sysv/linux/sh/kernel-features.h @@ -23,7 +23,6 @@ #include /* These syscalls were added for SH in 2.6.37. */ -#define __ASSUME_CONNECT_SYSCALL 1 #define __ASSUME_SEND_SYSCALL 1 #define __ASSUME_RECV_SYSCALL 1 From patchwork Wed Nov 18 19:55:41 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adhemerval Zanella Netto X-Patchwork-Id: 41115 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 9EDEF3945C2B; Wed, 18 Nov 2020 19:56:28 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 9EDEF3945C2B DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1605729388; bh=VmjXl/G/G+OGQpOjV7P2mwIgo74v6lUjC2xNUrVl3kQ=; h=To:Subject:Date:In-Reply-To:References:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=R3Ql6/m9rlxyE1g6dKaS1S0rVamdAg2FC8WuzGYxR2pfq8KSdFWQZFbBnXqJE7Ins j3J3/5v6Dzpy1u3tXuBwfFwrVHR5+uwolzJTGCddFmINpz/Obyeq8nnyvKJ1hnTMGw K+ozmEbc16p1DLSMWND8L2OTlXkM5Y1Uu59Iuqyo= X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from mail-qk1-x730.google.com (mail-qk1-x730.google.com [IPv6:2607:f8b0:4864:20::730]) by sourceware.org (Postfix) with ESMTPS id C417539450D3 for ; Wed, 18 Nov 2020 19:56:22 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org C417539450D3 Received: by mail-qk1-x730.google.com with SMTP id k4so3036255qko.13 for ; Wed, 18 Nov 2020 11:56:22 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=VmjXl/G/G+OGQpOjV7P2mwIgo74v6lUjC2xNUrVl3kQ=; b=HDdHwTY76aSHQk4Bb9p5XOYRi423nqIGEx80nBVdB8K3QTLRuGvPw8XmDOeWrUrnOV ITElNbEVxO/3fOXy+zLwqhhlITyidcJwz3RLoDhI0z50hXrRyV1Y/CC6Sw1OgXdaqXRi NhFU/28Z30tm9CDzxCxHsqNBKZKSoJQ7EYVJPNoJHo+Bx5SR+vETAwk3SsHT9n86/sWx wEgqUPKZj0sKdQawUYUip6GdpDRbYGC9ku7oGHXGlS0LKGQkk6r6epnN/eqVTSINbm6/ 13AOWu0VPNLMKxrP3tpEtDvtgHCsNA9Wl+HLTSnVkHL4Hi/41JT3KljZo5j/fWynqE/3 mmng== X-Gm-Message-State: AOAM530nip7zDXfgajwwBiayrrh5L2XK5eKI70uZd9kvmVMYRK1m88Zu /oHJ7HbuUBHruBhoz4WKfCdeRBpizWWgdg== X-Google-Smtp-Source: ABdhPJxfKqtdMCCIT09bzYrYgDe4vX4ISFBm5otf4JOsDlxsP1eAXI7dMznEOuYO2H4YD+yypmxLEQ== X-Received: by 2002:a37:dc4:: with SMTP id 187mr6437248qkn.397.1605729382113; Wed, 18 Nov 2020 11:56:22 -0800 (PST) Received: from localhost.localdomain ([177.194.48.209]) by smtp.googlemail.com with ESMTPSA id f27sm6538775qtv.95.2020.11.18.11.56.21 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 18 Nov 2020 11:56:21 -0800 (PST) To: libc-alpha@sourceware.org Subject: [PATCH 17/28] x86_64: Remove ununsed syscalls.list entry Date: Wed, 18 Nov 2020 16:55:41 -0300 Message-Id: <20201118195552.2687336-18-adhemerval.zanella@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20201118195552.2687336-1-adhemerval.zanella@linaro.org> References: <20201118195552.2687336-1-adhemerval.zanella@linaro.org> MIME-Version: 1.0 X-Spam-Status: No, score=-13.9 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Adhemerval Zanella via Libc-alpha From: Adhemerval Zanella Netto Reply-To: Adhemerval Zanella Errors-To: libc-alpha-bounces@sourceware.org Sender: "Libc-alpha" Its definition is not used anymore. Checked on x86_64-linux-gnu. --- sysdeps/unix/sysv/linux/x86_64/syscalls.list | 1 - 1 file changed, 1 deletion(-) diff --git a/sysdeps/unix/sysv/linux/x86_64/syscalls.list b/sysdeps/unix/sysv/linux/x86_64/syscalls.list index 2f7047be42..c04902db23 100644 --- a/sysdeps/unix/sysv/linux/x86_64/syscalls.list +++ b/sysdeps/unix/sysv/linux/x86_64/syscalls.list @@ -2,4 +2,3 @@ arch_prctl EXTRA arch_prctl i:ii __arch_prctl arch_prctl modify_ldt EXTRA modify_ldt i:ipi __modify_ldt modify_ldt -syscall_clock_gettime EXTRA clock_gettime Ei:ip __syscall_clock_gettime From patchwork Wed Nov 18 19:55:42 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adhemerval Zanella Netto X-Patchwork-Id: 41117 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id CC1B1394740E; Wed, 18 Nov 2020 19:56:29 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org CC1B1394740E DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1605729389; bh=0a8vJ78BUXXokdQGTokGiiolQdawGjbHgkmTvE7glQg=; h=To:Subject:Date:In-Reply-To:References:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=XPX8qS8P3OqmCORu9cK/Si/okZkRILyxJDI65G0XBt31EzmhO6tvq+VsPaHxkt7OI dEOitpy+xHrW0dUxx5N1sLaJAPcabmoVmDBdF8TvwoOCtXMVTGIlCx5rXk318GfAI9 J6ds3LRNv0OoVgvBdRJcx0kTiQYjM7AyhyIzdqjk= X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from mail-qk1-x742.google.com (mail-qk1-x742.google.com [IPv6:2607:f8b0:4864:20::742]) by sourceware.org (Postfix) with ESMTPS id 2E19039450DE for ; Wed, 18 Nov 2020 19:56:24 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 2E19039450DE Received: by mail-qk1-x742.google.com with SMTP id q5so3036831qkc.12 for ; Wed, 18 Nov 2020 11:56:24 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=0a8vJ78BUXXokdQGTokGiiolQdawGjbHgkmTvE7glQg=; b=CBnhInbQgnLVRxx+46BAbnNMqL3eNMFJ+vCUk3RTXwcR76sf8zVdg5U2h5wQSgbZgW tmVxNIxbPFC69/zn8IAbNk5k7xFoRqFnRTy6uwlPgkr/XgaPcF8hLGlqo28fUQdLxko+ TWbj4uwXZTTW0QZcJUoh2uOlZ8aBlj5WmXby7siHZnl+wAXfkV5Onk2PgD/HuqFF76ah KUHoTExIQC03QdKRI4vuDxdnhvgSwWG5B4bWgNr6dEb3o27HK6UAfQAZ3ZhYVWCUbA/Q 2CYk9SLFtzi4hTcXIsYTnrY8RP8FqgiKVngxa8DJRMzfk7cUsCRklaaNN0eyiML6U3HY 1C+w== X-Gm-Message-State: AOAM530dTYlUWVRCr2rVmTtae9Z9a8Q35fuRDWDQioD13Nif3iG082Wm 6k3kHM2IHrZ3her6efmq01GOG8O3RC6r6Q== X-Google-Smtp-Source: ABdhPJzwr1rGAjSJoyYWgdhfYwroyYTwMW5d+wAtL/4+Fm1i4lLXO5VpYROrxkqbyKh+9Q7LehV0oQ== X-Received: by 2002:a37:813:: with SMTP id 19mr6814223qki.438.1605729383414; Wed, 18 Nov 2020 11:56:23 -0800 (PST) Received: from localhost.localdomain ([177.194.48.209]) by smtp.googlemail.com with ESMTPSA id f27sm6538775qtv.95.2020.11.18.11.56.22 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 18 Nov 2020 11:56:23 -0800 (PST) To: libc-alpha@sourceware.org Subject: [PATCH 18/28] nptl: Add futex_trylock_pi Date: Wed, 18 Nov 2020 16:55:42 -0300 Message-Id: <20201118195552.2687336-19-adhemerval.zanella@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20201118195552.2687336-1-adhemerval.zanella@linaro.org> References: <20201118195552.2687336-1-adhemerval.zanella@linaro.org> MIME-Version: 1.0 X-Spam-Status: No, score=-13.9 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Adhemerval Zanella via Libc-alpha From: Adhemerval Zanella Netto Reply-To: Adhemerval Zanella Errors-To: libc-alpha-bounces@sourceware.org Sender: "Libc-alpha" This is similar to other futex wrappers on futex-internal. Checked on x86_64-linux-gnu. --- nptl/pthread_mutex_trylock.c | 9 +++----- sysdeps/nptl/futex-internal.h | 36 +++++++++++++++++++++++++++++++ sysdeps/nptl/lowlevellock-futex.h | 5 +++++ 3 files changed, 44 insertions(+), 6 deletions(-) diff --git a/nptl/pthread_mutex_trylock.c b/nptl/pthread_mutex_trylock.c index 2130f52529..be9d9a3bac 100644 --- a/nptl/pthread_mutex_trylock.c +++ b/nptl/pthread_mutex_trylock.c @@ -297,12 +297,9 @@ __pthread_mutex_trylock (pthread_mutex_t *mutex) int private = (robust ? PTHREAD_ROBUST_MUTEX_PSHARED (mutex) : PTHREAD_MUTEX_PSHARED (mutex)); - int e = INTERNAL_SYSCALL_CALL (futex, &mutex->__data.__lock, - __lll_private_flag (FUTEX_TRYLOCK_PI, - private), 0, 0); - - if (INTERNAL_SYSCALL_ERROR_P (e) - && INTERNAL_SYSCALL_ERRNO (e) == EWOULDBLOCK) + if (futex_trylock_pi ((unsigned int *) &mutex->__data.__lock, + private) + == -EWOULDBLOCK) { /* The kernel has not yet finished the mutex owner death. We do not need to ensure ordering wrt another memory diff --git a/sysdeps/nptl/futex-internal.h b/sysdeps/nptl/futex-internal.h index c27d0cdac8..3cda6c5762 100644 --- a/sysdeps/nptl/futex-internal.h +++ b/sysdeps/nptl/futex-internal.h @@ -483,6 +483,42 @@ futex_lock_pi64 (int *futex_word, const struct __timespec64 *abstime, } } +/* This operaration is similar to futex_lock_pi and it is used when the lock + information contains stale state (FUTEX_WAITERS and/or FUTEX_OWNER_DIED). + User space can not handle this condition in a race-free manner, but kernel + might handle it and acquire the futex. + + Returns: + + - 0 if woken by a PI unlock operation or spuriously. + - EAGAIN if the futex owner thread ID is about to exit, but has not yet + handled the state cleanup. + - EDEADLK if the futex is already locked by the caller. + - ESRCH if the thread ID int he futex does not exist. + - EINVAL is the state is corrupted or if there is a waiter on the + futex. +*/ +static __always_inline int +futex_trylock_pi (unsigned int *futex_word, int private) +{ + int err = lll_futex_trylock_pi ((int *) futex_word, private); + switch (err) + { + case 0: + case -EAGAIN: /* EWOULDBLOCK */ + case -EINTR: + case -ESRCH: + case -EDEADLK: + case -EPERM: + return -err; + + case -EINVAL: + case -EFAULT: + default: + futex_fatal_error (); + } +} + /* Wakes the top priority waiter that called a futex_lock_pi operation on the futex. diff --git a/sysdeps/nptl/lowlevellock-futex.h b/sysdeps/nptl/lowlevellock-futex.h index 2209ca76a1..0440aeb390 100644 --- a/sysdeps/nptl/lowlevellock-futex.h +++ b/sysdeps/nptl/lowlevellock-futex.h @@ -144,6 +144,11 @@ __lll_private_flag (FUTEX_LOCK_PI, private), \ 0, abstime) +#define lll_futex_trylock_pi(futexp, private) \ + lll_futex_syscall (4, futexp, \ + __lll_private_flag (FUTEX_TRYLOCK_PI, private), \ + 0, 0) + #define lll_futex_timed_unlock_pi(futexp, private) \ lll_futex_syscall (4, futexp, \ __lll_private_flag (FUTEX_UNLOCK_PI, private), \ From patchwork Wed Nov 18 19:55:43 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adhemerval Zanella Netto X-Patchwork-Id: 41118 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id C94BD3947407; Wed, 18 Nov 2020 19:56:30 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org C94BD3947407 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1605729390; bh=rAqekvWehT0r6RQrxQKsbFezUC5dyNNQtVO+CghHoVU=; h=To:Subject:Date:In-Reply-To:References:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=evvuxJwn7A0QgdlRMhdZE7oc2PykLlYj9bv/gvXkP5QBYHlRlBIsHT4qNGipNmsL7 X5JkzQ97gASv4p2t3MWTk125BmyyfOkiVUH+2SXtWuh7HRbteP166LK4iCNuZLPHLJ Jv+f1kScElzOiEB+HBGBRzTiHNkSW5YERh58wMlo= X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from mail-qk1-x741.google.com (mail-qk1-x741.google.com [IPv6:2607:f8b0:4864:20::741]) by sourceware.org (Postfix) with ESMTPS id 8C0A339450EA for ; Wed, 18 Nov 2020 19:56:25 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 8C0A339450EA Received: by mail-qk1-x741.google.com with SMTP id q22so3083460qkq.6 for ; Wed, 18 Nov 2020 11:56:25 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=rAqekvWehT0r6RQrxQKsbFezUC5dyNNQtVO+CghHoVU=; b=VM1GiHJWPNxreh8BREouJpwRCazZTTPkE2JgZoA95ohlRgG/YYZooB5Hz3YqBlBhHO PM3y1FVh049PcMdR6X3lg88D4BXrqnIE1vXBLMhw2dSPo118XO9bG7l/uwyLxk3SpU9F q2/CZoeA8sdVMf0m8vyGzwnSM2VfULbfX9RC6MGDn7fT8LqNN8AWmnUIZKM1qKxWKkWW Tipj/SeGfmj5u5k0auiAmurm0Uc87CkxYmq6ldTTv6Aax09bsyO4E2EseB7fEWiT24d+ SmxgSPXrgs4lGeoQds5RNZONLrBhFEZjw5bcAngp9tjCoD2mpRTEVr/4NcBwME37V5/j G08A== X-Gm-Message-State: AOAM533eX1XOTnzesMGZIz6R4lOZwp+M4lF3YHS4LvBpL1/yMnxKYKVs 2VvCF8YNx6MB/U6L2wWnq0iGJJ7YR7OQaQ== X-Google-Smtp-Source: ABdhPJyxhVTdfQMFJOyn2xegPrtkLd98Xbwld2oXCFKqw2Wjal9CIYC2kvMDA1qJifu3rV2GneEGUA== X-Received: by 2002:a37:ecb:: with SMTP id 194mr6417709qko.387.1605729384768; Wed, 18 Nov 2020 11:56:24 -0800 (PST) Received: from localhost.localdomain ([177.194.48.209]) by smtp.googlemail.com with ESMTPSA id f27sm6538775qtv.95.2020.11.18.11.56.23 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 18 Nov 2020 11:56:24 -0800 (PST) To: libc-alpha@sourceware.org Subject: [PATCH 19/28] linux: Add fanotify_mark C implementation Date: Wed, 18 Nov 2020 16:55:43 -0300 Message-Id: <20201118195552.2687336-20-adhemerval.zanella@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20201118195552.2687336-1-adhemerval.zanella@linaro.org> References: <20201118195552.2687336-1-adhemerval.zanella@linaro.org> MIME-Version: 1.0 X-Spam-Status: No, score=-13.9 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, KAM_SHORT, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Adhemerval Zanella via Libc-alpha From: Adhemerval Zanella Netto Reply-To: Adhemerval Zanella Errors-To: libc-alpha-bounces@sourceware.org Sender: "Libc-alpha" Passing 64-bit arguments on syscalls.list is tricky: it requires to reimplement the expected kernel abi in each architecture. This is way to better to represent in C code where we already have macros for this (SYSCALL_LL64). Checked on x86_64-linux-gnu. --- sysdeps/unix/sysv/linux/Makefile | 2 +- sysdeps/unix/sysv/linux/arm/syscalls.list | 2 -- sysdeps/unix/sysv/linux/fanotify_mark.c | 36 +++++++++++++++++++ .../linux/generic/wordsize-32/syscalls.list | 1 - sysdeps/unix/sysv/linux/hppa/fanotify_mark.c | 2 ++ sysdeps/unix/sysv/linux/hppa/syscalls.list | 1 - sysdeps/unix/sysv/linux/i386/syscalls.list | 2 -- sysdeps/unix/sysv/linux/m68k/syscalls.list | 1 - .../unix/sysv/linux/microblaze/syscalls.list | 1 - .../unix/sysv/linux/mips/mips32/syscalls.list | 2 -- .../sysv/linux/mips/mips64/n32/syscalls.list | 2 -- .../sysv/linux/mips/mips64/n64/syscalls.list | 2 -- .../linux/powerpc/powerpc32/syscalls.list | 1 - .../sysv/linux/s390/s390-32/syscalls.list | 1 - sysdeps/unix/sysv/linux/sh/fanotify_mark.c | 2 ++ sysdeps/unix/sysv/linux/sh/syscalls.list | 2 -- .../sysv/linux/sparc/sparc32/syscalls.list | 1 - .../unix/sysv/linux/wordsize-64/syscalls.list | 2 -- 18 files changed, 41 insertions(+), 22 deletions(-) create mode 100644 sysdeps/unix/sysv/linux/fanotify_mark.c create mode 100644 sysdeps/unix/sysv/linux/hppa/fanotify_mark.c create mode 100644 sysdeps/unix/sysv/linux/sh/fanotify_mark.c diff --git a/sysdeps/unix/sysv/linux/Makefile b/sysdeps/unix/sysv/linux/Makefile index 09604e128b..71bb4cbddd 100644 --- a/sysdeps/unix/sysv/linux/Makefile +++ b/sysdeps/unix/sysv/linux/Makefile @@ -61,7 +61,7 @@ sysdep_routines += adjtimex clone umount umount2 readahead sysctl \ open_by_handle_at mlock2 pkey_mprotect pkey_set pkey_get \ timerfd_gettime timerfd_settime prctl \ process_vm_readv process_vm_writev clock_adjtime \ - time64-support pselect32 + time64-support pselect32 fanotify_mark CFLAGS-gethostid.c = -fexceptions CFLAGS-tee.c = -fexceptions -fasynchronous-unwind-tables diff --git a/sysdeps/unix/sysv/linux/arm/syscalls.list b/sysdeps/unix/sysv/linux/arm/syscalls.list index 742ed64ec9..ef35963e82 100644 --- a/sysdeps/unix/sysv/linux/arm/syscalls.list +++ b/sysdeps/unix/sysv/linux/arm/syscalls.list @@ -16,5 +16,3 @@ setfsgid - setfsgid32 Ei:i setfsgid setfsuid - setfsuid32 Ei:i setfsuid prlimit64 EXTRA prlimit64 i:iipp prlimit64 - -fanotify_mark EXTRA fanotify_mark i:iiiiis fanotify_mark diff --git a/sysdeps/unix/sysv/linux/fanotify_mark.c b/sysdeps/unix/sysv/linux/fanotify_mark.c new file mode 100644 index 0000000000..6f8fd2e9cf --- /dev/null +++ b/sysdeps/unix/sysv/linux/fanotify_mark.c @@ -0,0 +1,36 @@ +/* Add, remove, or modify an fanotify mark on a filesystem object. + Linux specific syscall. + Copyright (C) 2020 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, see + . */ + +#include +#include + +int +__fanotify_mark (int fd, unsigned int flags, uint64_t mask, int dirfd, + const char *pathname) +{ + return INLINE_SYSCALL_CALL (fanotify_mark, fd, flags, SYSCALL_LL64 (mask), + dirfd, pathname); +} +#ifdef VERSION_fanotify_mark +# include +versioned_symbol (libc, __fanotify_mark, fanotify_mark, + VERSION_fanotify_mark); +#else +weak_alias (__fanotify_mark, fanotify_mark) +#endif diff --git a/sysdeps/unix/sysv/linux/generic/wordsize-32/syscalls.list b/sysdeps/unix/sysv/linux/generic/wordsize-32/syscalls.list index b775008a37..736edbe654 100644 --- a/sysdeps/unix/sysv/linux/generic/wordsize-32/syscalls.list +++ b/sysdeps/unix/sysv/linux/generic/wordsize-32/syscalls.list @@ -2,4 +2,3 @@ # rlimit APIs prlimit64 EXTRA prlimit64 i:iipp prlimit64 -fanotify_mark EXTRA fanotify_mark i:iiiiis fanotify_mark diff --git a/sysdeps/unix/sysv/linux/hppa/fanotify_mark.c b/sysdeps/unix/sysv/linux/hppa/fanotify_mark.c new file mode 100644 index 0000000000..ce347a4261 --- /dev/null +++ b/sysdeps/unix/sysv/linux/hppa/fanotify_mark.c @@ -0,0 +1,2 @@ +#define VERSION_fanotify_mark GLIBC_2_19 +#include diff --git a/sysdeps/unix/sysv/linux/hppa/syscalls.list b/sysdeps/unix/sysv/linux/hppa/syscalls.list index 11fada447c..a20bdc7726 100644 --- a/sysdeps/unix/sysv/linux/hppa/syscalls.list +++ b/sysdeps/unix/sysv/linux/hppa/syscalls.list @@ -1,4 +1,3 @@ # File name Caller Syscall name # args Strong name Weak names prlimit64 EXTRA prlimit64 i:iipp __prlimit64 prlimit64@@GLIBC_2.17 -fanotify_mark EXTRA fanotify_mark i:iiiiis __fanotify_mark fanotify_mark@@GLIBC_2.19 diff --git a/sysdeps/unix/sysv/linux/i386/syscalls.list b/sysdeps/unix/sysv/linux/i386/syscalls.list index 191081b949..a20d6ebf24 100644 --- a/sysdeps/unix/sysv/linux/i386/syscalls.list +++ b/sysdeps/unix/sysv/linux/i386/syscalls.list @@ -20,5 +20,3 @@ vm86old EXTRA vm86old i:p __vm86old vm86@GLIBC_2.0 vm86 - vm86 i:ip __vm86 vm86@@GLIBC_2.3.4 prlimit64 EXTRA prlimit64 i:iipp prlimit64 - -fanotify_mark EXTRA fanotify_mark i:iiiiis fanotify_mark diff --git a/sysdeps/unix/sysv/linux/m68k/syscalls.list b/sysdeps/unix/sysv/linux/m68k/syscalls.list index aba75b59e0..e28ccc2c45 100644 --- a/sysdeps/unix/sysv/linux/m68k/syscalls.list +++ b/sysdeps/unix/sysv/linux/m68k/syscalls.list @@ -17,4 +17,3 @@ setfsuid - setfsuid32 Ei:i setfsuid cacheflush EXTRA cacheflush i:iiii __cacheflush cacheflush prlimit64 EXTRA prlimit64 i:iipp prlimit64 -fanotify_mark EXTRA fanotify_mark i:iiiiis fanotify_mark diff --git a/sysdeps/unix/sysv/linux/microblaze/syscalls.list b/sysdeps/unix/sysv/linux/microblaze/syscalls.list index 4ff1c9da7e..f479ef0826 100644 --- a/sysdeps/unix/sysv/linux/microblaze/syscalls.list +++ b/sysdeps/unix/sysv/linux/microblaze/syscalls.list @@ -3,4 +3,3 @@ cacheflush EXTRA cacheflush i:iiii __cacheflush cacheflush prlimit64 EXTRA prlimit64 i:iipp prlimit64 -fanotify_mark EXTRA fanotify_mark i:iiiiis fanotify_mark diff --git a/sysdeps/unix/sysv/linux/mips/mips32/syscalls.list b/sysdeps/unix/sysv/linux/mips/mips32/syscalls.list index f357b5c918..dbeb184d73 100644 --- a/sysdeps/unix/sysv/linux/mips/mips32/syscalls.list +++ b/sysdeps/unix/sysv/linux/mips/mips32/syscalls.list @@ -1,5 +1,3 @@ # File name Caller Syscall name # args Strong name Weak names prlimit64 EXTRA prlimit64 i:iipp prlimit64 - -fanotify_mark EXTRA fanotify_mark i:iiiiis fanotify_mark diff --git a/sysdeps/unix/sysv/linux/mips/mips64/n32/syscalls.list b/sysdeps/unix/sysv/linux/mips/mips64/n32/syscalls.list index e6c511fecb..6135436182 100644 --- a/sysdeps/unix/sysv/linux/mips/mips64/n32/syscalls.list +++ b/sysdeps/unix/sysv/linux/mips/mips64/n32/syscalls.list @@ -5,5 +5,3 @@ lseek64 - lseek i:iii __lseek64 __libc_lseek64 lseek64@@GLIBC_2.2 llseek@GLIBC_2.0:GLIBC_2.28 prlimit64 EXTRA prlimit64 i:iipp prlimit64 - -fanotify_mark EXTRA fanotify_mark i:iiiis fanotify_mark diff --git a/sysdeps/unix/sysv/linux/mips/mips64/n64/syscalls.list b/sysdeps/unix/sysv/linux/mips/mips64/n64/syscalls.list index 8e7d516a2a..ecf9d80ed4 100644 --- a/sysdeps/unix/sysv/linux/mips/mips64/n64/syscalls.list +++ b/sysdeps/unix/sysv/linux/mips/mips64/n64/syscalls.list @@ -2,8 +2,6 @@ prlimit EXTRA prlimit64 i:iipp prlimit prlimit64 -fanotify_mark EXTRA fanotify_mark i:iiiis fanotify_mark - fstatfs - fstatfs i:ip __fstatfs fstatfs fstatfs64 __fstatfs64 statfs - statfs i:sp __statfs statfs statfs64 __statfs64 diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc32/syscalls.list b/sysdeps/unix/sysv/linux/powerpc/powerpc32/syscalls.list index 966856e64a..d31303250d 100644 --- a/sysdeps/unix/sysv/linux/powerpc/powerpc32/syscalls.list +++ b/sysdeps/unix/sysv/linux/powerpc/powerpc32/syscalls.list @@ -4,4 +4,3 @@ chown - chown i:sii __chown chown@@GLIBC_2.1 lchown - lchown i:sii __lchown lchown@@GLIBC_2.0 chown@GLIBC_2.0 prlimit64 EXTRA prlimit64 i:iipp prlimit64 -fanotify_mark EXTRA fanotify_mark i:iiiiis fanotify_mark diff --git a/sysdeps/unix/sysv/linux/s390/s390-32/syscalls.list b/sysdeps/unix/sysv/linux/s390/s390-32/syscalls.list index 5c267744db..1c565e9ba5 100644 --- a/sysdeps/unix/sysv/linux/s390/s390-32/syscalls.list +++ b/sysdeps/unix/sysv/linux/s390/s390-32/syscalls.list @@ -16,4 +16,3 @@ setfsgid - setfsgid32 Ei:i setfsgid setfsuid - setfsuid32 Ei:i setfsuid prlimit64 EXTRA prlimit64 i:iipp prlimit64 -fanotify_mark EXTRA fanotify_mark i:iiiiis fanotify_mark diff --git a/sysdeps/unix/sysv/linux/sh/fanotify_mark.c b/sysdeps/unix/sysv/linux/sh/fanotify_mark.c new file mode 100644 index 0000000000..3662f21b60 --- /dev/null +++ b/sysdeps/unix/sysv/linux/sh/fanotify_mark.c @@ -0,0 +1,2 @@ +#define VERSION_fanotify_mark GLIBC_2_16 +#include diff --git a/sysdeps/unix/sysv/linux/sh/syscalls.list b/sysdeps/unix/sysv/linux/sh/syscalls.list index 6c2d2c6535..ef35963e82 100644 --- a/sysdeps/unix/sysv/linux/sh/syscalls.list +++ b/sysdeps/unix/sysv/linux/sh/syscalls.list @@ -16,5 +16,3 @@ setfsgid - setfsgid32 Ei:i setfsgid setfsuid - setfsuid32 Ei:i setfsuid prlimit64 EXTRA prlimit64 i:iipp prlimit64 - -fanotify_mark EXTRA fanotify_mark i:iiiiis __fanotify_mark fanotify_mark@@GLIBC_2.16 diff --git a/sysdeps/unix/sysv/linux/sparc/sparc32/syscalls.list b/sysdeps/unix/sysv/linux/sparc/sparc32/syscalls.list index 0b6095ffab..4fcae65451 100644 --- a/sysdeps/unix/sysv/linux/sparc/sparc32/syscalls.list +++ b/sysdeps/unix/sysv/linux/sparc/sparc32/syscalls.list @@ -16,4 +16,3 @@ setfsgid - setfsgid32 Ei:i setfsgid setfsuid - setfsuid32 Ei:i setfsuid prlimit64 EXTRA prlimit64 i:iipp prlimit64 -fanotify_mark EXTRA fanotify_mark i:iiiiis fanotify_mark diff --git a/sysdeps/unix/sysv/linux/wordsize-64/syscalls.list b/sysdeps/unix/sysv/linux/wordsize-64/syscalls.list index 9316778dae..0404a1c0d7 100644 --- a/sysdeps/unix/sysv/linux/wordsize-64/syscalls.list +++ b/sysdeps/unix/sysv/linux/wordsize-64/syscalls.list @@ -4,5 +4,3 @@ fstatfs - fstatfs i:ip __fstatfs fstatfs fstatfs64 __fstatfs64 statfs - statfs i:sp __statfs statfs statfs64 sendfile - sendfile i:iipi sendfile sendfile64 prlimit EXTRA prlimit64 i:iipp prlimit prlimit64 - -fanotify_mark EXTRA fanotify_mark i:iiiis fanotify_mark From patchwork Wed Nov 18 19:55:44 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adhemerval Zanella Netto X-Patchwork-Id: 41119 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 5B1B9394743A; Wed, 18 Nov 2020 19:56:31 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 5B1B9394743A DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1605729391; bh=6BwrUQYctHN7tn+63TX58hwZMR4LVzbSLFMtMmU4UbU=; h=To:Subject:Date:In-Reply-To:References:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=h7PfHfOMZlT3CN4zyTkodzndeSXjbrgh8lVIGervr9ZT8w5EKXzspM+mR8uEv+B4/ dCo3S1JOXOb0cNYxyOEhgfR8nZTdrF5hAycUgtSojGg2ekEz8a1cE2ZDaEsqfjPxCU p9z+gwyWomqHKihpLJ5cgrjvnkLUIlnkbqV//jTc= X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from mail-qt1-x832.google.com (mail-qt1-x832.google.com [IPv6:2607:f8b0:4864:20::832]) by sourceware.org (Postfix) with ESMTPS id DC4CA39450FF for ; Wed, 18 Nov 2020 19:56:26 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org DC4CA39450FF Received: by mail-qt1-x832.google.com with SMTP id f93so2561566qtb.10 for ; Wed, 18 Nov 2020 11:56:26 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=6BwrUQYctHN7tn+63TX58hwZMR4LVzbSLFMtMmU4UbU=; b=csTFuyop/rUl6+hX7BJ4gN/y9EGQGSstUwzJ9FMtxLGICjJLIm9yYzZgkbUTuYtU3N F/fOwfRWOFyCFUC3Yc2OiHiLxlw82py3oyC+O/zFk2DGM/dUsvPloRMbb1K35Gu0UeEk JQrN2vAwVtgoTssZ7mupETFWTfeyNutGjy3h8AYATmNFTjB3v/JMvEohHQs6sjx1alBY IU4O4OogKKR1Fub2E7JegRLLUi999/COWm/e8xY1EPLZJ8ylLzv9+dzgcwDJWZfe+b/2 8X4PARPxWPMkytt7dY9XdEeRH8FaxZCjnljUZxilSKXDoMoCOIS9r+qIkwe6Pbw2DXlj oDYg== X-Gm-Message-State: AOAM531k0evP5s2SzJCurdRSQcSzXDeT/4fu1PDWsL/RYaqclrVr4Js8 Im4dk6xI67XOmbx+e+6YguaGHnmRBRUKjA== X-Google-Smtp-Source: ABdhPJz3hfzwxvuEKkMSoM8m3k3mWKn1zxplw/AhKouGmmNArh/Jim9z6vsS9KtMeh53xPIiMzohRQ== X-Received: by 2002:ac8:6b06:: with SMTP id w6mr6487391qts.6.1605729386111; Wed, 18 Nov 2020 11:56:26 -0800 (PST) Received: from localhost.localdomain ([177.194.48.209]) by smtp.googlemail.com with ESMTPSA id f27sm6538775qtv.95.2020.11.18.11.56.25 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 18 Nov 2020 11:56:25 -0800 (PST) To: libc-alpha@sourceware.org Subject: [PATCH 20/28] linux: Add prlimit64 C implementation Date: Wed, 18 Nov 2020 16:55:44 -0300 Message-Id: <20201118195552.2687336-21-adhemerval.zanella@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20201118195552.2687336-1-adhemerval.zanella@linaro.org> References: <20201118195552.2687336-1-adhemerval.zanella@linaro.org> MIME-Version: 1.0 X-Spam-Status: No, score=-13.9 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, KAM_SHORT, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Adhemerval Zanella via Libc-alpha From: Adhemerval Zanella Netto Reply-To: Adhemerval Zanella Errors-To: libc-alpha-bounces@sourceware.org Sender: "Libc-alpha" The LFS prlimit64 requires a arch-specific implementation in syscalls.list. Instead add a generic one that handles the required symbol alias for __RLIM_T_MATCHES_RLIM64_T. HPPA is the only outlier which requires a different default symbol. Checked on x86_64-linux-gnu and with build for the affected ABIs. --- sysdeps/unix/sysv/linux/Makefile | 2 +- sysdeps/unix/sysv/linux/arm/syscalls.list | 2 - .../linux/generic/wordsize-32/syscalls.list | 4 -- sysdeps/unix/sysv/linux/hppa/prlimit64.c | 2 + sysdeps/unix/sysv/linux/hppa/syscalls.list | 3 -- sysdeps/unix/sysv/linux/i386/syscalls.list | 2 - sysdeps/unix/sysv/linux/m68k/syscalls.list | 1 - .../unix/sysv/linux/microblaze/syscalls.list | 2 - .../unix/sysv/linux/mips/mips32/syscalls.list | 3 -- .../sysv/linux/mips/mips64/n32/syscalls.list | 2 - .../sysv/linux/mips/mips64/n64/syscalls.list | 2 - .../linux/powerpc/powerpc32/syscalls.list | 2 - sysdeps/unix/sysv/linux/prlimit.c | 2 + sysdeps/unix/sysv/linux/prlimit64.c | 39 +++++++++++++++++++ .../sysv/linux/s390/s390-32/syscalls.list | 2 - sysdeps/unix/sysv/linux/sh/syscalls.list | 2 - .../sysv/linux/sparc/sparc32/syscalls.list | 2 - .../unix/sysv/linux/wordsize-64/syscalls.list | 1 - 18 files changed, 44 insertions(+), 31 deletions(-) delete mode 100644 sysdeps/unix/sysv/linux/generic/wordsize-32/syscalls.list create mode 100644 sysdeps/unix/sysv/linux/hppa/prlimit64.c delete mode 100644 sysdeps/unix/sysv/linux/hppa/syscalls.list delete mode 100644 sysdeps/unix/sysv/linux/mips/mips32/syscalls.list create mode 100644 sysdeps/unix/sysv/linux/prlimit64.c diff --git a/sysdeps/unix/sysv/linux/Makefile b/sysdeps/unix/sysv/linux/Makefile index 71bb4cbddd..c3b24f9332 100644 --- a/sysdeps/unix/sysv/linux/Makefile +++ b/sysdeps/unix/sysv/linux/Makefile @@ -56,7 +56,7 @@ endif ifeq ($(subdir),misc) sysdep_routines += adjtimex clone umount umount2 readahead sysctl \ setfsuid setfsgid epoll_pwait signalfd \ - eventfd eventfd_read eventfd_write prlimit \ + eventfd eventfd_read eventfd_write prlimit prlimit64 \ personality epoll_wait tee vmsplice splice \ open_by_handle_at mlock2 pkey_mprotect pkey_set pkey_get \ timerfd_gettime timerfd_settime prctl \ diff --git a/sysdeps/unix/sysv/linux/arm/syscalls.list b/sysdeps/unix/sysv/linux/arm/syscalls.list index ef35963e82..8340745c86 100644 --- a/sysdeps/unix/sysv/linux/arm/syscalls.list +++ b/sysdeps/unix/sysv/linux/arm/syscalls.list @@ -14,5 +14,3 @@ getgroups - getgroups32 i:ip __getgroups getgroups setfsgid - setfsgid32 Ei:i setfsgid setfsuid - setfsuid32 Ei:i setfsuid - -prlimit64 EXTRA prlimit64 i:iipp prlimit64 diff --git a/sysdeps/unix/sysv/linux/generic/wordsize-32/syscalls.list b/sysdeps/unix/sysv/linux/generic/wordsize-32/syscalls.list deleted file mode 100644 index 736edbe654..0000000000 --- a/sysdeps/unix/sysv/linux/generic/wordsize-32/syscalls.list +++ /dev/null @@ -1,4 +0,0 @@ -# File name Caller Syscall name # args Strong name Weak names - -# rlimit APIs -prlimit64 EXTRA prlimit64 i:iipp prlimit64 diff --git a/sysdeps/unix/sysv/linux/hppa/prlimit64.c b/sysdeps/unix/sysv/linux/hppa/prlimit64.c new file mode 100644 index 0000000000..4554c81dd9 --- /dev/null +++ b/sysdeps/unix/sysv/linux/hppa/prlimit64.c @@ -0,0 +1,2 @@ +#define VERSION_prlimit64 GLIBC_2_17 +#include diff --git a/sysdeps/unix/sysv/linux/hppa/syscalls.list b/sysdeps/unix/sysv/linux/hppa/syscalls.list deleted file mode 100644 index a20bdc7726..0000000000 --- a/sysdeps/unix/sysv/linux/hppa/syscalls.list +++ /dev/null @@ -1,3 +0,0 @@ -# File name Caller Syscall name # args Strong name Weak names - -prlimit64 EXTRA prlimit64 i:iipp __prlimit64 prlimit64@@GLIBC_2.17 diff --git a/sysdeps/unix/sysv/linux/i386/syscalls.list b/sysdeps/unix/sysv/linux/i386/syscalls.list index a20d6ebf24..24412aabbc 100644 --- a/sysdeps/unix/sysv/linux/i386/syscalls.list +++ b/sysdeps/unix/sysv/linux/i386/syscalls.list @@ -18,5 +18,3 @@ setfsuid - setfsuid32 Ei:i setfsuid modify_ldt EXTRA modify_ldt i:ipi __modify_ldt modify_ldt vm86old EXTRA vm86old i:p __vm86old vm86@GLIBC_2.0 vm86 - vm86 i:ip __vm86 vm86@@GLIBC_2.3.4 - -prlimit64 EXTRA prlimit64 i:iipp prlimit64 diff --git a/sysdeps/unix/sysv/linux/m68k/syscalls.list b/sysdeps/unix/sysv/linux/m68k/syscalls.list index e28ccc2c45..e1e964dd1c 100644 --- a/sysdeps/unix/sysv/linux/m68k/syscalls.list +++ b/sysdeps/unix/sysv/linux/m68k/syscalls.list @@ -16,4 +16,3 @@ setfsgid - setfsgid32 Ei:i setfsgid setfsuid - setfsuid32 Ei:i setfsuid cacheflush EXTRA cacheflush i:iiii __cacheflush cacheflush -prlimit64 EXTRA prlimit64 i:iipp prlimit64 diff --git a/sysdeps/unix/sysv/linux/microblaze/syscalls.list b/sysdeps/unix/sysv/linux/microblaze/syscalls.list index f479ef0826..5367ef0d0b 100644 --- a/sysdeps/unix/sysv/linux/microblaze/syscalls.list +++ b/sysdeps/unix/sysv/linux/microblaze/syscalls.list @@ -1,5 +1,3 @@ # File name Caller Syscall name Args Strong name Weak names cacheflush EXTRA cacheflush i:iiii __cacheflush cacheflush - -prlimit64 EXTRA prlimit64 i:iipp prlimit64 diff --git a/sysdeps/unix/sysv/linux/mips/mips32/syscalls.list b/sysdeps/unix/sysv/linux/mips/mips32/syscalls.list deleted file mode 100644 index dbeb184d73..0000000000 --- a/sysdeps/unix/sysv/linux/mips/mips32/syscalls.list +++ /dev/null @@ -1,3 +0,0 @@ -# File name Caller Syscall name # args Strong name Weak names - -prlimit64 EXTRA prlimit64 i:iipp prlimit64 diff --git a/sysdeps/unix/sysv/linux/mips/mips64/n32/syscalls.list b/sysdeps/unix/sysv/linux/mips/mips64/n32/syscalls.list index 6135436182..6f665635e0 100644 --- a/sysdeps/unix/sysv/linux/mips/mips64/n32/syscalls.list +++ b/sysdeps/unix/sysv/linux/mips/mips64/n32/syscalls.list @@ -3,5 +3,3 @@ # C syscall macros cannot be used because this syscall has a 64-bit # return value. lseek64 - lseek i:iii __lseek64 __libc_lseek64 lseek64@@GLIBC_2.2 llseek@GLIBC_2.0:GLIBC_2.28 - -prlimit64 EXTRA prlimit64 i:iipp prlimit64 diff --git a/sysdeps/unix/sysv/linux/mips/mips64/n64/syscalls.list b/sysdeps/unix/sysv/linux/mips/mips64/n64/syscalls.list index ecf9d80ed4..50ab64d3c2 100644 --- a/sysdeps/unix/sysv/linux/mips/mips64/n64/syscalls.list +++ b/sysdeps/unix/sysv/linux/mips/mips64/n64/syscalls.list @@ -1,7 +1,5 @@ # File name Caller Syscall name # args Strong name Weak names -prlimit EXTRA prlimit64 i:iipp prlimit prlimit64 - fstatfs - fstatfs i:ip __fstatfs fstatfs fstatfs64 __fstatfs64 statfs - statfs i:sp __statfs statfs statfs64 __statfs64 diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc32/syscalls.list b/sysdeps/unix/sysv/linux/powerpc/powerpc32/syscalls.list index d31303250d..5231da94b2 100644 --- a/sysdeps/unix/sysv/linux/powerpc/powerpc32/syscalls.list +++ b/sysdeps/unix/sysv/linux/powerpc/powerpc32/syscalls.list @@ -2,5 +2,3 @@ chown - chown i:sii __chown chown@@GLIBC_2.1 lchown - lchown i:sii __lchown lchown@@GLIBC_2.0 chown@GLIBC_2.0 - -prlimit64 EXTRA prlimit64 i:iipp prlimit64 diff --git a/sysdeps/unix/sysv/linux/prlimit.c b/sysdeps/unix/sysv/linux/prlimit.c index e12eb4e9bc..6707cf6b1e 100644 --- a/sysdeps/unix/sysv/linux/prlimit.c +++ b/sysdeps/unix/sysv/linux/prlimit.c @@ -18,6 +18,7 @@ #include #include +#if !__RLIM_T_MATCHES_RLIM64_T int prlimit (__pid_t pid, enum __rlimit_resource resource, const struct rlimit *new_rlimit, struct rlimit *old_rlimit) @@ -73,3 +74,4 @@ prlimit (__pid_t pid, enum __rlimit_resource resource, return res; } +#endif /* __RLIM_T_MATCHES_RLIM64_T */ diff --git a/sysdeps/unix/sysv/linux/prlimit64.c b/sysdeps/unix/sysv/linux/prlimit64.c new file mode 100644 index 0000000000..e3a8718b98 --- /dev/null +++ b/sysdeps/unix/sysv/linux/prlimit64.c @@ -0,0 +1,39 @@ +/* Get/set resource limits. Linux specific syscall. + Copyright (C) 2020 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, see + . */ + +#define prlimit __redirect_prlimit +#include +#undef prlimit +#include + +int +__prlimit64 (pid_t pid, enum __rlimit_resource resource, + const struct rlimit64 *new_rlimit, struct rlimit64 *old_rlimit) +{ + return INLINE_SYSCALL_CALL (prlimit64, pid, resource, new_rlimit, + old_rlimit); +} +#ifdef VERSION_prlimit64 +# include +versioned_symbol (libc, __prlimit64, prlimit64, VERSION_prlimit64); +#else +strong_alias (__prlimit64, prlimit64) +# if __RLIM_T_MATCHES_RLIM64_T +strong_alias (prlimit64, prlimit) +# endif +#endif diff --git a/sysdeps/unix/sysv/linux/s390/s390-32/syscalls.list b/sysdeps/unix/sysv/linux/s390/s390-32/syscalls.list index 1c565e9ba5..fa05bac4d5 100644 --- a/sysdeps/unix/sysv/linux/s390/s390-32/syscalls.list +++ b/sysdeps/unix/sysv/linux/s390/s390-32/syscalls.list @@ -14,5 +14,3 @@ getgroups - getgroups32 i:ip __getgroups getgroups setfsgid - setfsgid32 Ei:i setfsgid setfsuid - setfsuid32 Ei:i setfsuid - -prlimit64 EXTRA prlimit64 i:iipp prlimit64 diff --git a/sysdeps/unix/sysv/linux/sh/syscalls.list b/sysdeps/unix/sysv/linux/sh/syscalls.list index ef35963e82..8340745c86 100644 --- a/sysdeps/unix/sysv/linux/sh/syscalls.list +++ b/sysdeps/unix/sysv/linux/sh/syscalls.list @@ -14,5 +14,3 @@ getgroups - getgroups32 i:ip __getgroups getgroups setfsgid - setfsgid32 Ei:i setfsgid setfsuid - setfsuid32 Ei:i setfsuid - -prlimit64 EXTRA prlimit64 i:iipp prlimit64 diff --git a/sysdeps/unix/sysv/linux/sparc/sparc32/syscalls.list b/sysdeps/unix/sysv/linux/sparc/sparc32/syscalls.list index 4fcae65451..9e4eb0a165 100644 --- a/sysdeps/unix/sysv/linux/sparc/sparc32/syscalls.list +++ b/sysdeps/unix/sysv/linux/sparc/sparc32/syscalls.list @@ -14,5 +14,3 @@ getgroups - getgroups32 i:ip __getgroups getgroups setfsgid - setfsgid32 Ei:i setfsgid setfsuid - setfsuid32 Ei:i setfsuid - -prlimit64 EXTRA prlimit64 i:iipp prlimit64 diff --git a/sysdeps/unix/sysv/linux/wordsize-64/syscalls.list b/sysdeps/unix/sysv/linux/wordsize-64/syscalls.list index 0404a1c0d7..c5b839e7c2 100644 --- a/sysdeps/unix/sysv/linux/wordsize-64/syscalls.list +++ b/sysdeps/unix/sysv/linux/wordsize-64/syscalls.list @@ -3,4 +3,3 @@ fstatfs - fstatfs i:ip __fstatfs fstatfs fstatfs64 __fstatfs64 statfs - statfs i:sp __statfs statfs statfs64 sendfile - sendfile i:iipi sendfile sendfile64 -prlimit EXTRA prlimit64 i:iipp prlimit prlimit64 From patchwork Wed Nov 18 19:55:45 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adhemerval Zanella Netto X-Patchwork-Id: 41120 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 533BA3947C0B; Wed, 18 Nov 2020 19:56:32 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 533BA3947C0B DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1605729392; bh=1NuOsrUAWLQZ0uayx/c3FKkgqZiYDqVU2UysWnIppJ4=; h=To:Subject:Date:In-Reply-To:References:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=QQTk96NWHN74WqvJQCoruDneemFmWYsudYB5fQFZfMGpTLaH23ev93zGIGlPuZTdE 4ZT9qgRNHVA1t+xWuhN/zpmk3WDLHB4RnJr/UhC6QdV+yor5fBJEm7mZdLyUbDjMky HN4bhQ0R/XI0Yw0z/i4ywtPH3ErMpPAo/oD7PeMw= X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from mail-qk1-x741.google.com (mail-qk1-x741.google.com [IPv6:2607:f8b0:4864:20::741]) by sourceware.org (Postfix) with ESMTPS id 37C413945C15 for ; Wed, 18 Nov 2020 19:56:28 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 37C413945C15 Received: by mail-qk1-x741.google.com with SMTP id d28so3038870qka.11 for ; Wed, 18 Nov 2020 11:56:28 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=1NuOsrUAWLQZ0uayx/c3FKkgqZiYDqVU2UysWnIppJ4=; b=k54I+jhHB9O06/ppIhWkqk0LM1r51+/FM3LYCmqA0FRAry2xYmzFcVru+U0d/p17F7 tPXp1kBCi1JPzmAJwvb/xYMsVtrthYcZtL6eczxqesreg9n2kwyp6vSCf8FLDdNf5fWD pcyR5Had+P511op9jssKqKVS0ogfyKo9ytfijtmAuOzI1hRc43ruZyQevqfbwIs62v30 RXQxspAbWTxRLOB2sBuJfP6Zl0bTMTnkCnJpL4EdMGVTuGJkwMEmbBowJU0jZ2sqT7D0 PsYIwrTycXR0oG+oRVaaSYv1yV8gtnzifnnotIzZJLzaV9YlxyqgfBP7YPaMh4zu8TNC Wing== X-Gm-Message-State: AOAM5327ZmSfadiLDanUK/mnME+jV1MrTz8e7OaC16fJGPjqjAVKNQdG ZySq6X0xOCOUxnRftEervlAjNvV606f46A== X-Google-Smtp-Source: ABdhPJx5CbVfvonZs6t+dhYU1Du85JaLK1BtAKxKIgfuH26JRFbcG1v3lZs4WecTFPql5OPGD+0jXg== X-Received: by 2002:a05:620a:218b:: with SMTP id g11mr6965221qka.190.1605729387467; Wed, 18 Nov 2020 11:56:27 -0800 (PST) Received: from localhost.localdomain ([177.194.48.209]) by smtp.googlemail.com with ESMTPSA id f27sm6538775qtv.95.2020.11.18.11.56.26 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 18 Nov 2020 11:56:27 -0800 (PST) To: libc-alpha@sourceware.org Subject: [PATCH 21/28] linux: Implement mremap in C Date: Wed, 18 Nov 2020 16:55:45 -0300 Message-Id: <20201118195552.2687336-22-adhemerval.zanella@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20201118195552.2687336-1-adhemerval.zanella@linaro.org> References: <20201118195552.2687336-1-adhemerval.zanella@linaro.org> MIME-Version: 1.0 X-Spam-Status: No, score=-13.9 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, KAM_SHORT, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Adhemerval Zanella via Libc-alpha From: Adhemerval Zanella Netto Reply-To: Adhemerval Zanella Errors-To: libc-alpha-bounces@sourceware.org Sender: "Libc-alpha" This avoid variadic function in syscalls.list and the possible mismatch between the asm syscall macros the required ABI to handle the variadic argument. Checked on x86_64-linux-gnu. --- sysdeps/unix/sysv/linux/Makefile | 2 +- sysdeps/unix/sysv/linux/mremap.c | 41 +++++++++++++++++++++++++++ sysdeps/unix/sysv/linux/syscalls.list | 1 - 3 files changed, 42 insertions(+), 2 deletions(-) create mode 100644 sysdeps/unix/sysv/linux/mremap.c diff --git a/sysdeps/unix/sysv/linux/Makefile b/sysdeps/unix/sysv/linux/Makefile index c3b24f9332..68818862dd 100644 --- a/sysdeps/unix/sysv/linux/Makefile +++ b/sysdeps/unix/sysv/linux/Makefile @@ -61,7 +61,7 @@ sysdep_routines += adjtimex clone umount umount2 readahead sysctl \ open_by_handle_at mlock2 pkey_mprotect pkey_set pkey_get \ timerfd_gettime timerfd_settime prctl \ process_vm_readv process_vm_writev clock_adjtime \ - time64-support pselect32 fanotify_mark + time64-support pselect32 fanotify_mark mremap CFLAGS-gethostid.c = -fexceptions CFLAGS-tee.c = -fexceptions -fasynchronous-unwind-tables diff --git a/sysdeps/unix/sysv/linux/mremap.c b/sysdeps/unix/sysv/linux/mremap.c new file mode 100644 index 0000000000..83b4e95338 --- /dev/null +++ b/sysdeps/unix/sysv/linux/mremap.c @@ -0,0 +1,41 @@ +/* Remap a virtual memory address. Linux specific syscall. + Copyright (C) 2020 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, see + . */ + +#include +#include +#include +#include + +void * +__mremap (void *addr, size_t old_len, size_t new_len, int flags, ...) +{ + va_list va; + void *new_addr = NULL; + + if (flags & MREMAP_FIXED) + { + va_start (va, flags); + new_addr = va_arg (va, void *); + va_end (va); + } + + return (void *) INLINE_SYSCALL_CALL (mremap, addr, old_len, new_len, flags, + new_addr); +} +libc_hidden_def (__mremap) +weak_alias (__mremap, mremap) diff --git a/sysdeps/unix/sysv/linux/syscalls.list b/sysdeps/unix/sysv/linux/syscalls.list index 01ec2bfa95..7a0172a422 100644 --- a/sysdeps/unix/sysv/linux/syscalls.list +++ b/sysdeps/unix/sysv/linux/syscalls.list @@ -35,7 +35,6 @@ mincore - mincore i:aUV mincore mlock - mlock i:bU mlock mlockall - mlockall i:i mlockall mount EXTRA mount i:sssUp __mount mount -mremap EXTRA mremap b:aUUip __mremap mremap munlock - munlock i:aU munlock munlockall - munlockall i: munlockall nfsservctl EXTRA nfsservctl i:ipp __compat_nfsservctl nfsservctl@GLIBC_2.0:GLIBC_2.28 From patchwork Wed Nov 18 19:55:46 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adhemerval Zanella Netto X-Patchwork-Id: 41121 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id DF4553947C38; Wed, 18 Nov 2020 19:56:32 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org DF4553947C38 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1605729392; bh=1HTymu6NMKG8u/I8kSakZbmbYoYcjm0NL95njlsA3vk=; h=To:Subject:Date:In-Reply-To:References:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=II3puVC7ZxfZRTofrpVLRFP+pufd8Czdg6LHkGy9Va8BDA+21uuxI6/pIlq+qvIRa WiTygjz9DK2jVfOy5Ws9Pe8z6hWaD3h9RRiq5WEpuFs89Fe0A2hNzZR/cLyfE2PG0o iBPAiIE0kox/gFhzwLEwzCRJX48t4x4yIHQTnLXg= X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from mail-qk1-x742.google.com (mail-qk1-x742.google.com [IPv6:2607:f8b0:4864:20::742]) by sourceware.org (Postfix) with ESMTPS id 68DE33947407 for ; Wed, 18 Nov 2020 19:56:29 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 68DE33947407 Received: by mail-qk1-x742.google.com with SMTP id d28so3038941qka.11 for ; Wed, 18 Nov 2020 11:56:29 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=1HTymu6NMKG8u/I8kSakZbmbYoYcjm0NL95njlsA3vk=; b=PfDEdRflX++Un4wQPxUHNjlPt/adgYeP6R+M2nFij+OgdJ+kSD4mJkqTC7q6nLAn2+ JiEV38vGM+xOD3UQHGjHrD1WWSuGsTdyZkD89JzGecNlEB/C5sewJg0TBU9j/oUJ6DnN G+FSp6xSHstueFeuKvnOW2vjpIm4DdAwONNvrSnJLgppxNxtWuIZh6q/BQMGEJcVoPEr HkCdBonQok/PA+LScMlkjCHOoN5zdocm1C8rQP1Xv0xVRa3FA3HLhEWCsRwCQvEHJyJu Bw0X51QOCfxoY4AZTkwpza9pB+YHxewe3CZMh4iAG1ENGMLD7O9YDW01arug95VcLBg+ LV7w== X-Gm-Message-State: AOAM532qOXpqgbua4niL527w72RJVdT3CNKWRGiENTH6LdY50qHmmabC jjVy3TSGpqHhX960tCxSqnXOF6yqHpKblA== X-Google-Smtp-Source: ABdhPJwRxW+caokBzrV4oNa95ntMTn5k+os8y4rVnvPAY2e/ZD91FJ42mumd3Ss+9NU0gypY6jbNsw== X-Received: by 2002:a05:620a:57b:: with SMTP id p27mr6497736qkp.417.1605729388805; Wed, 18 Nov 2020 11:56:28 -0800 (PST) Received: from localhost.localdomain ([177.194.48.209]) by smtp.googlemail.com with ESMTPSA id f27sm6538775qtv.95.2020.11.18.11.56.27 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 18 Nov 2020 11:56:28 -0800 (PST) To: libc-alpha@sourceware.org Subject: [PATCH 22/28] Linux: implement ioctl in C Date: Wed, 18 Nov 2020 16:55:46 -0300 Message-Id: <20201118195552.2687336-23-adhemerval.zanella@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20201118195552.2687336-1-adhemerval.zanella@linaro.org> References: <20201118195552.2687336-1-adhemerval.zanella@linaro.org> MIME-Version: 1.0 X-Spam-Status: No, score=-13.9 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, KAM_SHORT, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Adhemerval Zanella via Libc-alpha From: Adhemerval Zanella Netto Reply-To: Adhemerval Zanella Errors-To: libc-alpha-bounces@sourceware.org Sender: "Libc-alpha" This avoid variadic function in syscalls.list and the possible mismatch between the asm syscall macros the required ABI to handle the variadic argument. Checked on x86_64-linux-gnu. --- sysdeps/unix/syscalls.list | 1 - sysdeps/unix/sysv/linux/ioctl.c | 36 +++++++++++++++++++++++++++++++++ 2 files changed, 36 insertions(+), 1 deletion(-) create mode 100644 sysdeps/unix/sysv/linux/ioctl.c diff --git a/sysdeps/unix/syscalls.list b/sysdeps/unix/syscalls.list index 6d1a2ad441..353afe594f 100644 --- a/sysdeps/unix/syscalls.list +++ b/sysdeps/unix/syscalls.list @@ -31,7 +31,6 @@ getrlimit - getrlimit i:ip __getrlimit getrlimit getsockname - getsockname i:ibN __getsockname getsockname getsockopt - getsockopt i:iiiBN getsockopt getuid - getuid Ei: __getuid getuid -ioctl - ioctl i:iiI __ioctl ioctl kill - kill i:ii __kill kill link - link i:ss __link link listen - listen i:ii __listen listen diff --git a/sysdeps/unix/sysv/linux/ioctl.c b/sysdeps/unix/sysv/linux/ioctl.c new file mode 100644 index 0000000000..fe0dc5661e --- /dev/null +++ b/sysdeps/unix/sysv/linux/ioctl.c @@ -0,0 +1,36 @@ +/* Control device. Linux version. + Copyright (C) 2020 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, see + . */ + +#include +#include +#include + +int +__ioctl (int fd, unsigned long int request, ...) +{ + void *arg; + va_list va; + + va_start (va, request); + arg = va_arg (va, void *); + va_end (va); + + return INLINE_SYSCALL_CALL (ioctl, fd, request, arg); +} +libc_hidden_def (__ioctl) +weak_alias (__ioctl, ioctl) From patchwork Wed Nov 18 19:55:47 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adhemerval Zanella Netto X-Patchwork-Id: 41122 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 7395F3948446; Wed, 18 Nov 2020 19:56:37 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 7395F3948446 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1605729397; bh=h71hsFomLH5mRs+abJoI6OM8UWMM6W33h0BrBBI2Ync=; h=To:Subject:Date:In-Reply-To:References:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=OhliBISKWBvxGkxYA4BEFnXDL4E3NT8opy5AVFA9bAEsxV8ZU5CXGMGwhyg90yfjI awvO1pGh2CTDO/I3Uc4AOLwM5/AfzTzRHDLGFJFUkh04WqC4l+S4++7yUu8J/24C2q AfJB4EqfNI4D8dbxFL4s9ZihWyKphHpxzVKGkHf8= X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from mail-qt1-x836.google.com (mail-qt1-x836.google.com [IPv6:2607:f8b0:4864:20::836]) by sourceware.org (Postfix) with ESMTPS id E9389394742B for ; Wed, 18 Nov 2020 19:56:30 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org E9389394742B Received: by mail-qt1-x836.google.com with SMTP id g17so2610774qts.5 for ; Wed, 18 Nov 2020 11:56:30 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=h71hsFomLH5mRs+abJoI6OM8UWMM6W33h0BrBBI2Ync=; b=nYBGdNYia6m2vqs7zrUND5cSf6RIr3AI6Iupg37Od8hzHH2nTByJoCZeckRXnB4dw1 BoPAhFasZiZQxLHewDAlQN6wnbj77BLJ9pEGb7mvNkBE9I6AM8Y9i8N0rQi/ZGIRb/n6 +ZphKU6LnAeNLVSMHRdbCjw6/mDaC3TBKXLu4T6yJDuAxJvtVojdPQ1mJobjnxClL/6M fBeY+hAc5A8eeA6gaaW2+WvMC05bzPfX4Kpy5StM4YF9wSDIcKOB7F4rQCioOy6lDG/c MdsNRWacJnMgwRKATh3+NRjZNWpHtHECIeMW6X2TdD+I5PO236pkkm/aF34E6mZ4Bvux x5xg== X-Gm-Message-State: AOAM53120s2kCfjd9FARpFb60ZFZ+aQTDgG+uTAyc/v274Qe009+JoyX 0WDzN5/2rvyko1aDEW2ayQB2lCpgHLPt/Q== X-Google-Smtp-Source: ABdhPJwFOFUUrwSLz4KFzIxJhbGXyQjT5v6GSA/h+fNMI1yltekQvwVNSM1qxt8d/jOwmBC1KN/AHQ== X-Received: by 2002:ac8:3797:: with SMTP id d23mr5912154qtc.205.1605729390301; Wed, 18 Nov 2020 11:56:30 -0800 (PST) Received: from localhost.localdomain ([177.194.48.209]) by smtp.googlemail.com with ESMTPSA id f27sm6538775qtv.95.2020.11.18.11.56.29 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 18 Nov 2020 11:56:29 -0800 (PST) To: libc-alpha@sourceware.org Subject: [PATCH 23/28] mips: Implement n32 lseek64 in C Date: Wed, 18 Nov 2020 16:55:47 -0300 Message-Id: <20201118195552.2687336-24-adhemerval.zanella@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20201118195552.2687336-1-adhemerval.zanella@linaro.org> References: <20201118195552.2687336-1-adhemerval.zanella@linaro.org> MIME-Version: 1.0 X-Spam-Status: No, score=-13.9 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, KAM_SHORT, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Adhemerval Zanella via Libc-alpha From: Adhemerval Zanella Netto Reply-To: Adhemerval Zanella Errors-To: libc-alpha-bounces@sourceware.org Sender: "Libc-alpha" Checked on mips64-n32-linux-gnu. --- .../unix/sysv/linux/mips/mips64/n32/lseek64.c | 47 +++++++++++++++++++ .../sysv/linux/mips/mips64/n32/syscalls.list | 5 -- 2 files changed, 47 insertions(+), 5 deletions(-) create mode 100644 sysdeps/unix/sysv/linux/mips/mips64/n32/lseek64.c delete mode 100644 sysdeps/unix/sysv/linux/mips/mips64/n32/syscalls.list diff --git a/sysdeps/unix/sysv/linux/mips/mips64/n32/lseek64.c b/sysdeps/unix/sysv/linux/mips/mips64/n32/lseek64.c new file mode 100644 index 0000000000..65cec75caf --- /dev/null +++ b/sysdeps/unix/sysv/linux/mips/mips64/n32/lseek64.c @@ -0,0 +1,47 @@ +/* Linux lseek implementation, 64 bits off_t. MIPS64n32 version. + Copyright (C) 2020 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library. If not, see + . */ + +#include +#include + +static inline off64_t +__lseek64_syscall (long int name, int fd, off64_t offset, int whence) +{ + register __syscall_arg_t s0 asm ("$16") = name; + register __syscall_arg_t v0 asm ("$2"); + register __syscall_arg_t a0 asm ("$4") = ARGIFY (fd); + register __syscall_arg_t a1 asm ("$5") = ARGIFY (offset); + register __syscall_arg_t a2 asm ("$6") = ARGIFY (whence); + register __syscall_arg_t a3 asm ("$7"); + asm volatile (".set\tnoreorder\n\t" + MOVE32 "\t%0, %2\n\t" + "syscall\n\t" + ".set reorder" + : "=r" (v0), "=r" (a3) + : "r" (s0), "r" (a0), "r" (a1), "r" (a2) + : __SYSCALL_CLOBBERS); + return a3 != 0 + ? SYSCALL_ERROR_LABEL (INTERNAL_SYSCALL_ERRNO (v0)) + : v0; +} + +#undef INLINE_SYSCALL_CALL +#define INLINE_SYSCALL_CALL(name, ...) \ + __lseek64_syscall(__NR_##name, __VA_ARGS__) + +#include diff --git a/sysdeps/unix/sysv/linux/mips/mips64/n32/syscalls.list b/sysdeps/unix/sysv/linux/mips/mips64/n32/syscalls.list deleted file mode 100644 index 6f665635e0..0000000000 --- a/sysdeps/unix/sysv/linux/mips/mips64/n32/syscalls.list +++ /dev/null @@ -1,5 +0,0 @@ -# File name Caller Syscall name # args Strong name Weak names - -# C syscall macros cannot be used because this syscall has a 64-bit -# return value. -lseek64 - lseek i:iii __lseek64 __libc_lseek64 lseek64@@GLIBC_2.2 llseek@GLIBC_2.0:GLIBC_2.28 From patchwork Wed Nov 18 19:55:48 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adhemerval Zanella Netto X-Patchwork-Id: 41124 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 270A13948D95; Wed, 18 Nov 2020 19:56:39 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 270A13948D95 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1605729399; bh=ZenPwEi115pTT4YX6gM51fP5WH/NztANyBT47K3bygc=; h=To:Subject:Date:In-Reply-To:References:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=TTMD/5YytOdyYLhxM+Pew+YIOrEY9vBog+BvOg0FFhkbC0/t+Sk1BgPktTX0N2IIa CJ5jZjgFVcjgZMNrsPWT7ULWk1gPQKy3qceSLCy95ertwYB3LoGjIPhf0sxVxMdOFf RlfseFp3vFKCOB38cZgfurt3n22I9sKznOfPt4A8= X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from mail-qk1-x736.google.com (mail-qk1-x736.google.com [IPv6:2607:f8b0:4864:20::736]) by sourceware.org (Postfix) with ESMTPS id 8F6B33947C0D for ; Wed, 18 Nov 2020 19:56:32 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 8F6B33947C0D Received: by mail-qk1-x736.google.com with SMTP id 199so3051200qkg.9 for ; Wed, 18 Nov 2020 11:56:32 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=ZenPwEi115pTT4YX6gM51fP5WH/NztANyBT47K3bygc=; b=B8JWfnPjn8FSX3K0gZHtf2+ALdeXTaDmhkqvgLBB3z+fxThwwWH93yT/Bj/QoLRKAR 1+Cy3OPRbp7uBVe2IEuLoS/ueann0sHuuZSW1CutLM4i0ZPddCL8SokLp2BLFxErnXam mhKq3gx1g4LS0FXoqcAtoGQV+ZdBFaVZFmPj7hK+THXYrQKZYPhy60AFgtiOPgKmLIer MRXbAXwhk0witnNhXMQ6rm7ENxb8IWQZtCCUtBrmUo9HVRqk/Lj2vNkSoi7t8axul9+R IMxgygomH8VcqhbjxNkPYQ1HcFIrBfuDUBVLAd4i8Cuz6WNEh/6p4SwGjn7oIYba4PTv otPQ== X-Gm-Message-State: AOAM531wgORG00XwzfyrTqeKCIiJQ6O2zm1xNrLOe2RGklBw0Pn2+GXo T1yjJvE6hJ+VMnHLHmQwxo+K7sPZci41zw== X-Google-Smtp-Source: ABdhPJztxM8UbKjybi4nJn43+9hiR2WtgWfhqV0+9WB+AbW/FEzy06fR+c2as8xThQwciiJ10vZ74g== X-Received: by 2002:ae9:dc81:: with SMTP id q123mr6805513qkf.426.1605729391627; Wed, 18 Nov 2020 11:56:31 -0800 (PST) Received: from localhost.localdomain ([177.194.48.209]) by smtp.googlemail.com with ESMTPSA id f27sm6538775qtv.95.2020.11.18.11.56.30 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 18 Nov 2020 11:56:31 -0800 (PST) To: libc-alpha@sourceware.org Subject: [PATCH 24/28] x32: Implement lseek64 in C Date: Wed, 18 Nov 2020 16:55:48 -0300 Message-Id: <20201118195552.2687336-25-adhemerval.zanella@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20201118195552.2687336-1-adhemerval.zanella@linaro.org> References: <20201118195552.2687336-1-adhemerval.zanella@linaro.org> MIME-Version: 1.0 X-Spam-Status: No, score=-13.9 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, KAM_SHORT, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Adhemerval Zanella via Libc-alpha From: Adhemerval Zanella Netto Reply-To: Adhemerval Zanella Errors-To: libc-alpha-bounces@sourceware.org Sender: "Libc-alpha" Checked on x86_64-linux-gnu-x32 --- sysdeps/unix/sysv/linux/x86_64/x32/lseek.S | 43 ------------------- sysdeps/unix/sysv/linux/x86_64/x32/lseek64.S | 1 - sysdeps/unix/sysv/linux/x86_64/x32/lseek64.c | 44 ++++++++++++++++++++ 3 files changed, 44 insertions(+), 44 deletions(-) delete mode 100644 sysdeps/unix/sysv/linux/x86_64/x32/lseek.S delete mode 100644 sysdeps/unix/sysv/linux/x86_64/x32/lseek64.S create mode 100644 sysdeps/unix/sysv/linux/x86_64/x32/lseek64.c diff --git a/sysdeps/unix/sysv/linux/x86_64/x32/lseek.S b/sysdeps/unix/sysv/linux/x86_64/x32/lseek.S deleted file mode 100644 index ca656ba12a..0000000000 --- a/sysdeps/unix/sysv/linux/x86_64/x32/lseek.S +++ /dev/null @@ -1,43 +0,0 @@ -/* The lseek system call with 64-bit offset. Linux/x32 version. - Copyright (C) 2012-2020 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, see - . */ - -#include - -/* Return -1LL in a full 64 bits. */ -#undef SYSCALL_ERROR_HANDLER -#define SYSCALL_ERROR_HANDLER \ -0: \ - SYSCALL_SET_ERRNO; \ - orq $-1, %rax; \ - ret; - -/* Always use our own error handler. */ -#undef SYSCALL_ERROR_LABEL -#define SYSCALL_ERROR_LABEL 0f - -PSEUDO (__libc_lseek64, lseek, 3) - ret -PSEUDO_END (__libc_lseek64) - -weak_alias (__libc_lseek64, __lseek64) -libc_hidden_weak (__lseek64) -weak_alias (__libc_lseek64, lseek64) -libc_hidden_weak (lseek64) -weak_alias (__libc_lseek64, __lseek) -libc_hidden_weak (__lseek) -weak_alias (__libc_lseek64, lseek) diff --git a/sysdeps/unix/sysv/linux/x86_64/x32/lseek64.S b/sysdeps/unix/sysv/linux/x86_64/x32/lseek64.S deleted file mode 100644 index d81e98fb51..0000000000 --- a/sysdeps/unix/sysv/linux/x86_64/x32/lseek64.S +++ /dev/null @@ -1 +0,0 @@ -/* We don't need a definition since the llseek function is what we need. */ diff --git a/sysdeps/unix/sysv/linux/x86_64/x32/lseek64.c b/sysdeps/unix/sysv/linux/x86_64/x32/lseek64.c new file mode 100644 index 0000000000..49c959943b --- /dev/null +++ b/sysdeps/unix/sysv/linux/x86_64/x32/lseek64.c @@ -0,0 +1,44 @@ +/* Linux lseek implementation, 64 bits off_t. x86_64/x32 version. + Copyright (C) 2020 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library. If not, see + . */ + +#include +#include +#include + +static inline off64_t +__lseek64_syscall (long int name, int fd, off64_t offset, int whence) +{ + off64_t resultvar; + asm volatile ("syscall\n\t" + : "=a" (resultvar) + : "0" (name), "D" (fd), "S" (offset), "d" (whence) + : "memory", "cc", "r11", "cx"); + return resultvar < 0 + ? SYSCALL_ERROR_LABEL (INTERNAL_SYSCALL_ERRNO (resultvar)) + : resultvar; +} + +#undef INLINE_SYSCALL_CALL +#define INLINE_SYSCALL_CALL(name, ...) \ + __lseek64_syscall(__NR_##name, __VA_ARGS__) + +/* Disable the llseek compat symbol. */ +#undef SHLIB_COMPAT +#define SHLIB_COMPAT(a, b, c) 0 + +#include From patchwork Wed Nov 18 19:55:49 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adhemerval Zanella Netto X-Patchwork-Id: 41123 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 203583948827; Wed, 18 Nov 2020 19:56:38 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 203583948827 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1605729398; bh=LAmCIwVJjt1mq6/5hOQQztmVoSA505wgt3FG+/GYPus=; h=To:Subject:Date:In-Reply-To:References:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=KdOttoYGEaOT7nxZR1a9qxtQSCFG1FWd2ORGbVPSCzkMB+gZVTWCP8bpEVsYdotV5 jNJC8XpVZxjtfyeg927qypyscej7+n1bq5OW8UhVfRfOWqsVpyAqMHJhYgJ7rk2VT6 xvxM6r3OieQfeWreorzK5bBy5o8FWyKTfW2v0/PY= X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from mail-qv1-xf30.google.com (mail-qv1-xf30.google.com [IPv6:2607:f8b0:4864:20::f30]) by sourceware.org (Postfix) with ESMTPS id 175E33948024 for ; Wed, 18 Nov 2020 19:56:34 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 175E33948024 Received: by mail-qv1-xf30.google.com with SMTP id ec16so1693979qvb.0 for ; Wed, 18 Nov 2020 11:56:34 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=LAmCIwVJjt1mq6/5hOQQztmVoSA505wgt3FG+/GYPus=; b=XXtPnymcVvcWImX7+rbyMINLwror82LbAJIeuyv8ONYiDn36r23IB13UzpXRRr+b6V Y7tvUEJ3GSzmO1sjEPBYm5hhPEszkyyFYbbiRRq42nZLBnhipE1ewWk/+wKr1TLkoEBp FfZt6KnnDB0b7aGt+VyvM+uWO9PShzUcf3c0Rqntt9kEE4kSth021CPbcbZscxzn7oop 5f7pLJMINvl4KfvjgI9FdfGsDzslEWzarzHjPPlJsbCwheGyeoxyBr4M+zFXRUjKwOIW TFawCHt63wzciEOhJ0i+THsCs6f1jUyh1BVXru02I7Dgmq1hQ4AIdyteLnVoDft7L/mF ffcg== X-Gm-Message-State: AOAM532y/UbLvucj8t0PFionHVIVx/hrkeEa7t/yC1LfT7jFRbih5vMq HSlKhcjOY3owKKDDi+UYcPhqeCLV8f6Pfg== X-Google-Smtp-Source: ABdhPJxVHVbPZ+T3susl77vrd6vgCmZBMfuiUlkYLMyGX711sLpKVwEHhG0GMK87ZpmS6t87SJkJUA== X-Received: by 2002:a0c:a544:: with SMTP id y62mr6578365qvy.11.1605729393152; Wed, 18 Nov 2020 11:56:33 -0800 (PST) Received: from localhost.localdomain ([177.194.48.209]) by smtp.googlemail.com with ESMTPSA id f27sm6538775qtv.95.2020.11.18.11.56.32 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 18 Nov 2020 11:56:32 -0800 (PST) To: libc-alpha@sourceware.org Subject: [PATCH 25/28] linux: Implement pipe in terms of __NR_pipe2 Date: Wed, 18 Nov 2020 16:55:49 -0300 Message-Id: <20201118195552.2687336-26-adhemerval.zanella@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20201118195552.2687336-1-adhemerval.zanella@linaro.org> References: <20201118195552.2687336-1-adhemerval.zanella@linaro.org> MIME-Version: 1.0 X-Spam-Status: No, score=-13.6 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, KAM_NUMSUBJECT, KAM_SHORT, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Adhemerval Zanella via Libc-alpha From: Adhemerval Zanella Netto Reply-To: Adhemerval Zanella Errors-To: libc-alpha-bounces@sourceware.org Sender: "Libc-alpha" It removes the arch-specific implementation for alpha, ia64, mips, sh, and sparc which requires a different kernel ABI than the usual one. Checked on x86_64-linux-gnu and with a build for the affected ABIs. --- sysdeps/unix/alpha/pipe.S | 31 --------------- sysdeps/unix/mips/pipe.S | 32 --------------- sysdeps/unix/sysv/linux/alpha/pipe.S | 1 - sysdeps/unix/sysv/linux/ia64/pipe.S | 37 ----------------- sysdeps/unix/sysv/linux/mips/pipe.S | 1 - sysdeps/unix/sysv/linux/{generic => }/pipe.c | 6 +-- sysdeps/unix/sysv/linux/sh/pipe.S | 42 -------------------- sysdeps/unix/sysv/linux/sparc/sparc32/pipe.S | 39 ------------------ sysdeps/unix/sysv/linux/sparc/sparc64/pipe.S | 40 ------------------- sysdeps/unix/sysv/linux/syscalls.list | 1 - 10 files changed, 3 insertions(+), 227 deletions(-) delete mode 100644 sysdeps/unix/alpha/pipe.S delete mode 100644 sysdeps/unix/mips/pipe.S delete mode 100644 sysdeps/unix/sysv/linux/alpha/pipe.S delete mode 100644 sysdeps/unix/sysv/linux/ia64/pipe.S delete mode 100644 sysdeps/unix/sysv/linux/mips/pipe.S rename sysdeps/unix/sysv/linux/{generic => }/pipe.c (86%) delete mode 100644 sysdeps/unix/sysv/linux/sh/pipe.S delete mode 100644 sysdeps/unix/sysv/linux/sparc/sparc32/pipe.S delete mode 100644 sysdeps/unix/sysv/linux/sparc/sparc64/pipe.S diff --git a/sysdeps/unix/alpha/pipe.S b/sysdeps/unix/alpha/pipe.S deleted file mode 100644 index ae2d94b061..0000000000 --- a/sysdeps/unix/alpha/pipe.S +++ /dev/null @@ -1,31 +0,0 @@ -/* Copyright (C) 1993-2020 Free Software Foundation, Inc. - This file is part of the GNU C Library. - Contributed by David Mosberger (davidm@cs.arizona.edu). - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library. If not, see - . */ - -/* __pipe is a special syscall since it returns two values. */ - -#include - -PSEUDO (__pipe, pipe, 0) - stl r0, 0(a0) - stl r1, 4(a0) - mov zero, v0 - ret -PSEUDO_END(__pipe) - -libc_hidden_def (__pipe) -weak_alias (__pipe, pipe) diff --git a/sysdeps/unix/mips/pipe.S b/sysdeps/unix/mips/pipe.S deleted file mode 100644 index d541c138c1..0000000000 --- a/sysdeps/unix/mips/pipe.S +++ /dev/null @@ -1,32 +0,0 @@ -/* Copyright (C) 1992-2020 Free Software Foundation, Inc. - This file is part of the GNU C Library. - Contributed by Brendan Kehoe (brendan@zen.org). - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library. If not, see - . */ - -#include - -SYSCALL__ (pipe, 1) - /* Plop in the two descriptors. */ - sw v0, 0(a0) - sw v1, 4(a0) - - /* Go out with a clean status. */ - move v0, zero - j ra -PSEUDO_END(__pipe) - -libc_hidden_def (__pipe) -weak_alias (__pipe, pipe) diff --git a/sysdeps/unix/sysv/linux/alpha/pipe.S b/sysdeps/unix/sysv/linux/alpha/pipe.S deleted file mode 100644 index 1e7ec1c199..0000000000 --- a/sysdeps/unix/sysv/linux/alpha/pipe.S +++ /dev/null @@ -1 +0,0 @@ -#include diff --git a/sysdeps/unix/sysv/linux/ia64/pipe.S b/sysdeps/unix/sysv/linux/ia64/pipe.S deleted file mode 100644 index c5b8189a28..0000000000 --- a/sysdeps/unix/sysv/linux/ia64/pipe.S +++ /dev/null @@ -1,37 +0,0 @@ -/* Copyright (C) 1999-2020 Free Software Foundation, Inc. - This file is part of the GNU C Library. - Contributed by David Mosberger - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, see - . */ - -/* __pipe is a special syscall since it returns two values. */ - -#include - -ENTRY(__pipe) - .regstk 1,0,0,0 - DO_CALL (SYS_ify (pipe)) - cmp.ne p6,p0=-1,r10 - ;; -(p6) st4 [in0]=r8,4 -(p6) mov ret0=0 - ;; -(p6) st4 [in0]=r9 -(p6) ret - br.cond.spnt.few __syscall_error -PSEUDO_END(__pipe) - -libc_hidden_def (__pipe) -weak_alias (__pipe, pipe) diff --git a/sysdeps/unix/sysv/linux/mips/pipe.S b/sysdeps/unix/sysv/linux/mips/pipe.S deleted file mode 100644 index 1708888da4..0000000000 --- a/sysdeps/unix/sysv/linux/mips/pipe.S +++ /dev/null @@ -1 +0,0 @@ -#include diff --git a/sysdeps/unix/sysv/linux/generic/pipe.c b/sysdeps/unix/sysv/linux/pipe.c similarity index 86% rename from sysdeps/unix/sysv/linux/generic/pipe.c rename to sysdeps/unix/sysv/linux/pipe.c index 52f3231cb8..0ea6ca5842 100644 --- a/sysdeps/unix/sysv/linux/generic/pipe.c +++ b/sysdeps/unix/sysv/linux/pipe.c @@ -1,6 +1,6 @@ -/* Copyright (C) 2011-2020 Free Software Foundation, Inc. +/* Create create pipe. Linux generic version. + Copyright (C) 2020 Free Software Foundation, Inc. This file is part of the GNU C Library. - Contributed by Chris Metcalf , 2011. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public @@ -26,7 +26,7 @@ int __pipe (int __pipedes[2]) { - return INLINE_SYSCALL (pipe2, 2, __pipedes, 0); + return INLINE_SYSCALL_CALL (pipe2, __pipedes, 0); } libc_hidden_def (__pipe) weak_alias (__pipe, pipe) diff --git a/sysdeps/unix/sysv/linux/sh/pipe.S b/sysdeps/unix/sysv/linux/sh/pipe.S deleted file mode 100644 index 0e7a5a4ded..0000000000 --- a/sysdeps/unix/sysv/linux/sh/pipe.S +++ /dev/null @@ -1,42 +0,0 @@ -/* Copyright (C) 1999-2020 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, see - . */ - -#include - -ENTRY (__libc_pipe) - mov #+__NR_pipe, r3 - trapa #0x10 - mov r0, r3 - mov #-12, r2 - shad r2, r3 - not r3, r3 // r1=0 means r0 = -1 to -4095 - tst r3, r3 // i.e. error in linux - bt 1f - mov.l r0, @r4 - mov.l r1, @(4, r4) - rts - mov #0, r0 -1: - SYSCALL_ERROR_HANDLER -.Lpseudo_end: - rts - nop -PSEUDO_END (__libc_pipe) - -weak_alias (__libc_pipe, __pipe) -libc_hidden_def (__pipe) -weak_alias (__libc_pipe, pipe) diff --git a/sysdeps/unix/sysv/linux/sparc/sparc32/pipe.S b/sysdeps/unix/sysv/linux/sparc/sparc32/pipe.S deleted file mode 100644 index 0b10f1522b..0000000000 --- a/sysdeps/unix/sysv/linux/sparc/sparc32/pipe.S +++ /dev/null @@ -1,39 +0,0 @@ -/* Copyright (C) 1997-2020 Free Software Foundation, Inc. - This file is part of the GNU C Library. - Contributed by Miguel de Icaza , 1997. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, see - . */ - -#include - - .text - .globl __syscall_error -ENTRY(__libc_pipe) - mov %o0, %o2 /* Save PIPEDES. */ - mov SYS_ify(pipe),%g1 - ta 0x10 - bcc 1f - mov %o7, %g1 - call __syscall_error - mov %g1, %o7 -1: st %o0, [%o2] /* PIPEDES[0] = %o0; */ - st %o1, [%o2 + 4] /* PIPEDES[1] = %o1; */ - retl - clr %o0 -END(__libc_pipe) - -weak_alias (__libc_pipe, __pipe) -libc_hidden_def (__pipe) -weak_alias (__libc_pipe, pipe) diff --git a/sysdeps/unix/sysv/linux/sparc/sparc64/pipe.S b/sysdeps/unix/sysv/linux/sparc/sparc64/pipe.S deleted file mode 100644 index 072a1936ea..0000000000 --- a/sysdeps/unix/sysv/linux/sparc/sparc64/pipe.S +++ /dev/null @@ -1,40 +0,0 @@ -/* Copyright (C) 1997-2020 Free Software Foundation, Inc. - This file is part of the GNU C Library. - Contributed by Miguel de Icaza , 1997. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, see - . */ - -#include - - .text - - .globl __syscall_error -ENTRY(__libc_pipe) - mov %o0, %o2 /* Save PIPEDES. */ - LOADSYSCALL(pipe) - ta 0x6d - bcc,pt %xcc, 1f - mov %o7, %g1 - call __syscall_error - mov %g1, %o7 -1: st %o0, [%o2] /* PIPEDES[0] = %o0; */ - st %o1, [%o2 + 4] /* PIPEDES[1] = %o1; */ - retl - clr %o0 -END(__libc_pipe) - -weak_alias (__libc_pipe, __pipe) -libc_hidden_def (__pipe) -weak_alias (__libc_pipe, pipe) diff --git a/sysdeps/unix/sysv/linux/syscalls.list b/sysdeps/unix/sysv/linux/syscalls.list index 7a0172a422..483caca465 100644 --- a/sysdeps/unix/sysv/linux/syscalls.list +++ b/sysdeps/unix/sysv/linux/syscalls.list @@ -38,7 +38,6 @@ mount EXTRA mount i:sssUp __mount mount munlock - munlock i:aU munlock munlockall - munlockall i: munlockall nfsservctl EXTRA nfsservctl i:ipp __compat_nfsservctl nfsservctl@GLIBC_2.0:GLIBC_2.28 -pipe - pipe i:f __pipe pipe pipe2 - pipe2 i:fi __pipe2 pipe2 pivot_root EXTRA pivot_root i:ss pivot_root query_module EXTRA query_module i:sipip __compat_query_module query_module@GLIBC_2.0:GLIBC_2.23 From patchwork Wed Nov 18 19:55:50 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Adhemerval Zanella Netto X-Patchwork-Id: 41126 X-Patchwork-Delegate: tuliom@linux.vnet.ibm.com Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 510EA3949D80; Wed, 18 Nov 2020 19:56:42 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 510EA3949D80 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1605729402; bh=uyYIBDULqgqouivg5fMOmOE9dwkM2TrMmpY1eIbNfIQ=; h=To:Subject:Date:In-Reply-To:References:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=NM2HKKdrQVFtR2U0qLGQoP1TY2tlyBHoGutEVbO03aij+1CM5984VBKDqrbwq3D25 bIFAvb3qTU2UYpWVpe2WPCNINcSUujbNFgFFrrt/6aHn4+ernwbJdcXW8UrdiAPbgX keIXvLKnEoC3UI/Pd4tw+oWfDDJUVAWY12dDWOyE= X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from mail-qk1-x743.google.com (mail-qk1-x743.google.com [IPv6:2607:f8b0:4864:20::743]) by sourceware.org (Postfix) with ESMTPS id 59737394742B for ; Wed, 18 Nov 2020 19:56:36 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 59737394742B Received: by mail-qk1-x743.google.com with SMTP id v143so3107119qkb.2 for ; Wed, 18 Nov 2020 11:56:36 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=uyYIBDULqgqouivg5fMOmOE9dwkM2TrMmpY1eIbNfIQ=; b=WrQo/v6nBsbxsD+ZvpORNtF9EoXqDlwYmKBbthJnkv9Kqg+QeAoG01pOLLTxk1060E DXVY/tS8kNm/YRcCBB8hTyfuY0IUtLu9vqi7CdMfEt4ipx84JF2JW/JHmBJAxgytECax RojEEBrpooJOtTdr6RNIfgWjmFZbfI26ijKKs9dEqXVOi3nblFphmLFioHtnq6AracV6 zKkMbfKM/FzZIgaptzOA2vlylQrX9lNb4+2cxzerJMjYW7ii6ruke+Mevvc0dfPNV130 6qhrmlI0Vy1HeTk4Qn/3PaiUY2ghRwAN7KT1P0Z1h0GG7ewHXTY9SSltrrt9NQz6o00p tvZw== X-Gm-Message-State: AOAM532hwJecQywqnRvSvNQFqymr+plFah7mZbGxt0qz9/KdKXxIyXC0 gLIbTDhC4uFNz8Xs6zfCD/JgAHcGnxQgGA== X-Google-Smtp-Source: ABdhPJwERkCS3ZPtzO8OS6t4CZQGyQPvkOjCDP7pL+n4XLsz6yzHoRd+8KKGsjoVVn/1ckV2kJNbYw== X-Received: by 2002:a37:9f14:: with SMTP id i20mr6259852qke.137.1605729394641; Wed, 18 Nov 2020 11:56:34 -0800 (PST) Received: from localhost.localdomain ([177.194.48.209]) by smtp.googlemail.com with ESMTPSA id f27sm6538775qtv.95.2020.11.18.11.56.33 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 18 Nov 2020 11:56:34 -0800 (PST) To: libc-alpha@sourceware.org Subject: [PATCH 26/28] linux: Consolidate brk implementation Date: Wed, 18 Nov 2020 16:55:50 -0300 Message-Id: <20201118195552.2687336-27-adhemerval.zanella@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20201118195552.2687336-1-adhemerval.zanella@linaro.org> References: <20201118195552.2687336-1-adhemerval.zanella@linaro.org> MIME-Version: 1.0 X-Spam-Status: No, score=-13.9 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, KAM_SHORT, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Adhemerval Zanella via Libc-alpha From: Adhemerval Zanella Netto Reply-To: Adhemerval Zanella Errors-To: libc-alpha-bounces@sourceware.org Sender: "Libc-alpha" It removes all the arch-specific assembly implementation. The only outlier is alpha where its kernel ABI to return error is to return the EINVAL as the returned value instead of address lower than the requested one. Also some ABIs exports an additional ___brk_addr symbol and to handle it an internal HAVE_INTERNAL_BRK_ADDR_SYMBOL. Checked on x86_64-linux-gnu and with build for the affected ABIs. Reviewed-by: Tulio Magno Quites Machado Filho --- sysdeps/unix/sysv/linux/aarch64/sysdep.h | 3 + sysdeps/unix/sysv/linux/alpha/brk.S | 83 -------------- sysdeps/unix/sysv/linux/{arm => alpha}/brk.c | 13 +-- sysdeps/unix/sysv/linux/alpha/dl-brk.S | 1 - sysdeps/unix/sysv/linux/arc/sysdep.h | 3 + sysdeps/unix/sysv/linux/{generic => }/brk.c | 6 +- sysdeps/unix/sysv/linux/csky/sysdep.h | 3 + sysdeps/unix/sysv/linux/dl-brk.c | 5 - sysdeps/unix/sysv/linux/hppa/brk.c | 41 ------- sysdeps/unix/sysv/linux/i386/brk.c | 45 -------- sysdeps/unix/sysv/linux/i386/sysdep.h | 3 + sysdeps/unix/sysv/linux/ia64/brk.S | 50 --------- sysdeps/unix/sysv/linux/ia64/dl-brk.S | 1 - sysdeps/unix/sysv/linux/ia64/sysdep.h | 3 + sysdeps/unix/sysv/linux/m68k/brk.c | 46 -------- sysdeps/unix/sysv/linux/m68k/sysdep.h | 3 + sysdeps/unix/sysv/linux/microblaze/brk.c | 42 ------- sysdeps/unix/sysv/linux/microblaze/sysdep.h | 3 + sysdeps/unix/sysv/linux/mips/brk.c | 46 -------- sysdeps/unix/sysv/linux/mips/mips32/sysdep.h | 3 + sysdeps/unix/sysv/linux/mips/mips64/sysdep.h | 3 + sysdeps/unix/sysv/linux/nios2/sysdep.h | 3 + sysdeps/unix/sysv/linux/pipe.c | 2 +- sysdeps/unix/sysv/linux/powerpc/dl-brk.S | 1 - .../unix/sysv/linux/powerpc/powerpc32/brk.S | 52 --------- .../unix/sysv/linux/powerpc/powerpc64/brk.S | 43 -------- sysdeps/unix/sysv/linux/riscv/sysdep.h | 3 + sysdeps/unix/sysv/linux/s390/brk.c | 55 --------- sysdeps/unix/sysv/linux/s390/s390-32/sysdep.h | 5 + sysdeps/unix/sysv/linux/s390/s390-64/sysdep.h | 5 + sysdeps/unix/sysv/linux/sh/brk.c | 47 -------- sysdeps/unix/sysv/linux/sparc/sparc32/brk.c | 54 --------- .../unix/sysv/linux/sparc/sparc32/sysdep.h | 3 + sysdeps/unix/sysv/linux/sparc/sparc64/brk.S | 104 ------------------ .../unix/sysv/linux/sparc/sparc64/dl-brk.S | 1 - sysdeps/unix/sysv/linux/sysdep.h | 4 + sysdeps/unix/sysv/linux/x86_64/brk.c | 41 ------- 37 files changed, 60 insertions(+), 769 deletions(-) delete mode 100644 sysdeps/unix/sysv/linux/alpha/brk.S rename sysdeps/unix/sysv/linux/{arm => alpha}/brk.c (77%) delete mode 100644 sysdeps/unix/sysv/linux/alpha/dl-brk.S rename sysdeps/unix/sysv/linux/{generic => }/brk.c (90%) delete mode 100644 sysdeps/unix/sysv/linux/dl-brk.c delete mode 100644 sysdeps/unix/sysv/linux/hppa/brk.c delete mode 100644 sysdeps/unix/sysv/linux/i386/brk.c delete mode 100644 sysdeps/unix/sysv/linux/ia64/brk.S delete mode 100644 sysdeps/unix/sysv/linux/ia64/dl-brk.S delete mode 100644 sysdeps/unix/sysv/linux/m68k/brk.c delete mode 100644 sysdeps/unix/sysv/linux/microblaze/brk.c delete mode 100644 sysdeps/unix/sysv/linux/mips/brk.c delete mode 100644 sysdeps/unix/sysv/linux/powerpc/dl-brk.S delete mode 100644 sysdeps/unix/sysv/linux/powerpc/powerpc32/brk.S delete mode 100644 sysdeps/unix/sysv/linux/powerpc/powerpc64/brk.S delete mode 100644 sysdeps/unix/sysv/linux/s390/brk.c delete mode 100644 sysdeps/unix/sysv/linux/sh/brk.c delete mode 100644 sysdeps/unix/sysv/linux/sparc/sparc32/brk.c delete mode 100644 sysdeps/unix/sysv/linux/sparc/sparc64/brk.S delete mode 100644 sysdeps/unix/sysv/linux/sparc/sparc64/dl-brk.S delete mode 100644 sysdeps/unix/sysv/linux/x86_64/brk.c diff --git a/sysdeps/unix/sysv/linux/aarch64/sysdep.h b/sysdeps/unix/sysv/linux/aarch64/sysdep.h index 319a7c7ac5..e526328ea4 100644 --- a/sysdeps/unix/sysv/linux/aarch64/sysdep.h +++ b/sysdeps/unix/sysv/linux/aarch64/sysdep.h @@ -234,6 +234,9 @@ # define INTERNAL_SYSCALL_NCS(number, nr, args...) \ INTERNAL_SYSCALL_RAW (number, nr, args) +#undef HAVE_INTERNAL_BRK_ADDR_SYMBOL +#define HAVE_INTERNAL_BRK_ADDR_SYMBOL 1 + #endif /* __ASSEMBLER__ */ /* Pointer mangling is supported for AArch64. */ diff --git a/sysdeps/unix/sysv/linux/alpha/brk.S b/sysdeps/unix/sysv/linux/alpha/brk.S deleted file mode 100644 index 5596b346d8..0000000000 --- a/sysdeps/unix/sysv/linux/alpha/brk.S +++ /dev/null @@ -1,83 +0,0 @@ -/* Copyright (C) 1993-2020 Free Software Foundation, Inc. - This file is part of the GNU C Library. - Contributed by Brendan Kehoe , 1993. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library. If not, see - . */ - -/* __brk is a special syscall under Linux since it never returns an - error. Instead, the error condition is indicated by returning the old - break value (instead of the new, requested one). */ - -#include -#include - -#ifdef PIC -.section .bss - .align 3 - .globl __curbrk -__curbrk: .skip 8 - .type __curbrk,@object - .size __curbrk,8 -#else -.comm __curbrk, 8 -#endif - - .text - .align 4 - .globl __brk - .ent __brk - .usepv __brk, std - - cfi_startproc -__brk: - ldgp gp, 0(t12) - subq sp, 16, sp - cfi_adjust_cfa_offset (16) -#ifdef PROF - .set noat - lda AT, _mcount - jsr AT, (AT), _mcount - .set at -#endif - - /* Save the requested brk across the system call. */ - stq a0, 0(sp) - - ldiq v0, __NR_brk - call_pal PAL_callsys - - ldq a0, 0(sp) - addq sp, 16, sp - cfi_adjust_cfa_offset (-16) - - /* Be prepared for an OSF-style brk. */ - bne a3, SYSCALL_ERROR_LABEL - beq v0, $ok - - /* Correctly handle the brk(0) query case. */ - cmoveq a0, v0, a0 - xor a0, v0, t0 - lda v0, ENOMEM - bne t0, SYSCALL_ERROR_LABEL - - /* Update __curbrk and return cleanly. */ - lda v0, 0 -$ok: stq a0, __curbrk - ret - -PSEUDO_END(__brk) - cfi_endproc - -weak_alias (__brk, brk) diff --git a/sysdeps/unix/sysv/linux/arm/brk.c b/sysdeps/unix/sysv/linux/alpha/brk.c similarity index 77% rename from sysdeps/unix/sysv/linux/arm/brk.c rename to sysdeps/unix/sysv/linux/alpha/brk.c index d4878939ae..d105a50724 100644 --- a/sysdeps/unix/sysv/linux/arm/brk.c +++ b/sysdeps/unix/sysv/linux/alpha/brk.c @@ -1,5 +1,5 @@ -/* brk system call for Linux/ARM. - Copyright (C) 1995-2020 Free Software Foundation, Inc. +/* Change data segment size. Linux/Alpha. + Copyright (C) 2020 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -20,17 +20,14 @@ #include #include -/* This must be initialized data because commons can't have aliases. */ void *__curbrk = 0; int __brk (void *addr) { - void *newbrk; - - __curbrk = newbrk = (void *) INLINE_SYSCALL (brk, 1, addr); - - if (newbrk < addr) + /* Alpha brk returns -ENOMEM in case of failure. */ + __curbrk = (void *) INTERNAL_SYSCALL_CALL (brk, addr); + if ((unsigned long) __curbrk == -ENOMEM) { __set_errno (ENOMEM); return -1; diff --git a/sysdeps/unix/sysv/linux/alpha/dl-brk.S b/sysdeps/unix/sysv/linux/alpha/dl-brk.S deleted file mode 100644 index eeb96544e3..0000000000 --- a/sysdeps/unix/sysv/linux/alpha/dl-brk.S +++ /dev/null @@ -1 +0,0 @@ -#include diff --git a/sysdeps/unix/sysv/linux/arc/sysdep.h b/sysdeps/unix/sysv/linux/arc/sysdep.h index 8465a2f623..24d8866d66 100644 --- a/sysdeps/unix/sysv/linux/arc/sysdep.h +++ b/sysdeps/unix/sysv/linux/arc/sysdep.h @@ -221,6 +221,9 @@ hidden_proto (__syscall_error) # define PTR_MANGLE(var) (void) (var) # define PTR_DEMANGLE(var) (void) (var) +# undef HAVE_INTERNAL_BRK_ADDR_SYMBOL +# define HAVE_INTERNAL_BRK_ADDR_SYMBOL 1 + #endif /* !__ASSEMBLER__ */ #endif /* linux/arc/sysdep.h */ diff --git a/sysdeps/unix/sysv/linux/generic/brk.c b/sysdeps/unix/sysv/linux/brk.c similarity index 90% rename from sysdeps/unix/sysv/linux/generic/brk.c rename to sysdeps/unix/sysv/linux/brk.c index 40a80ab970..0b6d6d0b70 100644 --- a/sysdeps/unix/sysv/linux/generic/brk.c +++ b/sysdeps/unix/sysv/linux/brk.c @@ -1,6 +1,6 @@ -/* Copyright (C) 2011-2020 Free Software Foundation, Inc. +/* Change data segment. Linux generic version. + Copyright (C) 2020 Free Software Foundation, Inc. This file is part of the GNU C Library. - Contributed by Chris Metcalf , 2011. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public @@ -23,10 +23,12 @@ /* This must be initialized data because commons can't have aliases. */ void *__curbrk = 0; +#if HAVE_INTERNAL_BRK_ADDR_SYMBOL /* Old braindamage in GCC's crtstuff.c requires this symbol in an attempt to work around different old braindamage in the old Linux ELF dynamic linker. */ weak_alias (__curbrk, ___brk_addr) +#endif int __brk (void *addr) diff --git a/sysdeps/unix/sysv/linux/csky/sysdep.h b/sysdeps/unix/sysv/linux/csky/sysdep.h index 7e8e89dd42..92216572a6 100644 --- a/sysdeps/unix/sysv/linux/csky/sysdep.h +++ b/sysdeps/unix/sysv/linux/csky/sysdep.h @@ -461,6 +461,9 @@ __local_syscall_error: \ # define INTERNAL_SYSCALL_NCS(number, nr, args...) \ INTERNAL_SYSCALL_RAW##nr (number, args) +#undef HAVE_INTERNAL_BRK_ADDR_SYMBOL +#define HAVE_INTERNAL_BRK_ADDR_SYMBOL 1 + #endif /* __ASSEMBLER__ */ /* Pointer mangling support. */ diff --git a/sysdeps/unix/sysv/linux/dl-brk.c b/sysdeps/unix/sysv/linux/dl-brk.c deleted file mode 100644 index c37cdfec33..0000000000 --- a/sysdeps/unix/sysv/linux/dl-brk.c +++ /dev/null @@ -1,5 +0,0 @@ -/* We can use the normal code but we also know the __curbrk is not exported - from ld.so. */ -extern void *__curbrk attribute_hidden; - -#include diff --git a/sysdeps/unix/sysv/linux/hppa/brk.c b/sysdeps/unix/sysv/linux/hppa/brk.c deleted file mode 100644 index 89d1fd1835..0000000000 --- a/sysdeps/unix/sysv/linux/hppa/brk.c +++ /dev/null @@ -1,41 +0,0 @@ -/* brk system call for Linux/HPPA. - Copyright (C) 1995-2020 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library. If not, see - . */ - -#include -#include -#include - -/* This must be initialized data because commons can't have aliases. */ -void *__curbrk = 0; - -int -__brk (void *addr) -{ - void *newbrk; - - __curbrk = newbrk = (void *) INLINE_SYSCALL (brk, 1, addr); - - if (newbrk < addr) - { - __set_errno (ENOMEM); - return -1; - } - - return 0; -} -weak_alias (__brk, brk) diff --git a/sysdeps/unix/sysv/linux/i386/brk.c b/sysdeps/unix/sysv/linux/i386/brk.c deleted file mode 100644 index 021b6d37a0..0000000000 --- a/sysdeps/unix/sysv/linux/i386/brk.c +++ /dev/null @@ -1,45 +0,0 @@ -/* brk system call for Linux/i386. - Copyright (C) 1995-2020 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, see - . */ - -#if BUILD_PIE_DEFAULT -/* Can't use "call *%gs:SYSINFO_OFFSET" during statup in static PIE. */ -# define I386_USE_SYSENTER 0 -#endif - -#include -#include -#include - -/* This must be initialized data because commons can't have aliases. */ -void *__curbrk = 0; - -/* Old braindamage in GCC's crtstuff.c requires this symbol in an attempt - to work around different old braindamage in the old Linux ELF dynamic - linker. */ -weak_alias (__curbrk, ___brk_addr) - -int -__brk (void *addr) -{ - void *newbrk = (void *) INTERNAL_SYSCALL_CALL (brk, addr); - __curbrk = newbrk; - if (newbrk < addr) - return INLINE_SYSCALL_ERROR_RETURN_VALUE (ENOMEM); - return 0; -} -weak_alias (__brk, brk) diff --git a/sysdeps/unix/sysv/linux/i386/sysdep.h b/sysdeps/unix/sysv/linux/i386/sysdep.h index bfb5de3b45..addd13dff1 100644 --- a/sysdeps/unix/sysv/linux/i386/sysdep.h +++ b/sysdeps/unix/sysv/linux/i386/sysdep.h @@ -291,6 +291,9 @@ struct libc_do_syscall_args # define HAVE_TIME_VSYSCALL "__vdso_time" # define HAVE_CLOCK_GETRES_VSYSCALL "__vdso_clock_getres" +# undef HAVE_INTERNAL_BRK_ADDR_SYMBOL +# define HAVE_INTERNAL_BRK_ADDR_SYMBOL 1 + /* Define a macro which expands inline into the wrapper code for a system call. This use is for internal calls that do not need to handle errors normally. It will never touch errno. This returns just what the kernel diff --git a/sysdeps/unix/sysv/linux/ia64/brk.S b/sysdeps/unix/sysv/linux/ia64/brk.S deleted file mode 100644 index 734d3467a7..0000000000 --- a/sysdeps/unix/sysv/linux/ia64/brk.S +++ /dev/null @@ -1,50 +0,0 @@ -/* brk system call for Linux/ia64 - Copyright (C) 1999-2020 Free Software Foundation, Inc. - This file is part of the GNU C Library. - Written by Stéphane Eranian and - Jes Sorensen, , April 1999. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, see - . */ - -#include - -#include - - .global __curbrk - .type __curbrk,@object - .size __curbrk,8 - .data - .align 8 -__curbrk: - data8 0 - -weak_alias (__curbrk, ___brk_addr) - -LEAF(__brk) - .regstk 1, 0, 0, 0 - DO_CALL(__NR_brk) - cmp.ltu p6, p0 = ret0, in0 - addl r9 = @ltoff(__curbrk), gp - ;; - ld8 r9 = [r9] -(p6) mov ret0 = ENOMEM -(p6) br.cond.spnt.few __syscall_error - ;; - st8 [r9] = ret0 - mov ret0 = 0 - ret -END(__brk) - -weak_alias (__brk, brk) diff --git a/sysdeps/unix/sysv/linux/ia64/dl-brk.S b/sysdeps/unix/sysv/linux/ia64/dl-brk.S deleted file mode 100644 index eeb96544e3..0000000000 --- a/sysdeps/unix/sysv/linux/ia64/dl-brk.S +++ /dev/null @@ -1 +0,0 @@ -#include diff --git a/sysdeps/unix/sysv/linux/ia64/sysdep.h b/sysdeps/unix/sysv/linux/ia64/sysdep.h index 03ed52552e..e6bcaabecc 100644 --- a/sysdeps/unix/sysv/linux/ia64/sysdep.h +++ b/sysdeps/unix/sysv/linux/ia64/sysdep.h @@ -172,6 +172,9 @@ #else /* not __ASSEMBLER__ */ +#undef HAVE_INTERNAL_BRK_ADDR_SYMBOL +#define HAVE_INTERNAL_BRK_ADDR_SYMBOL 1 + #define BREAK_INSN_1(num) "break " #num ";;\n\t" #define BREAK_INSN(num) BREAK_INSN_1(num) diff --git a/sysdeps/unix/sysv/linux/m68k/brk.c b/sysdeps/unix/sysv/linux/m68k/brk.c deleted file mode 100644 index ee88acbdc4..0000000000 --- a/sysdeps/unix/sysv/linux/m68k/brk.c +++ /dev/null @@ -1,46 +0,0 @@ -/* brk system call for Linux/m68k. - Copyright (C) 1996-2020 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library. If not, see - . */ - -#include -#include -#include - -void *__curbrk = 0; - -/* Old braindamage in GCC's crtstuff.c requires this symbol in an attempt - to work around different old braindamage in the old Linux/x86 ELF - dynamic linker. Sigh. */ -weak_alias (__curbrk, ___brk_addr) - -int -__brk (void *addr) -{ - void *newbrk; - - newbrk = (void *) INTERNAL_SYSCALL_CALL (brk, addr); - __curbrk = newbrk; - - if (newbrk < addr) - { - __set_errno (ENOMEM); - return -1; - } - - return 0; -} -weak_alias (__brk, brk) diff --git a/sysdeps/unix/sysv/linux/m68k/sysdep.h b/sysdeps/unix/sysv/linux/m68k/sysdep.h index 3e0ab605de..fe7cf5babb 100644 --- a/sysdeps/unix/sysv/linux/m68k/sysdep.h +++ b/sysdeps/unix/sysv/linux/m68k/sysdep.h @@ -292,6 +292,9 @@ SYSCALL_ERROR_LABEL: \ LOAD_REGS_5 #define ASM_ARGS_6 ASM_ARGS_5, "a" (_a0) +#undef HAVE_INTERNAL_BRK_ADDR_SYMBOL +#define HAVE_INTERNAL_BRK_ADDR_SYMBOL 1 + #endif /* not __ASSEMBLER__ */ /* Pointer mangling is not yet supported for M68K. */ diff --git a/sysdeps/unix/sysv/linux/microblaze/brk.c b/sysdeps/unix/sysv/linux/microblaze/brk.c deleted file mode 100644 index 20c3e625e4..0000000000 --- a/sysdeps/unix/sysv/linux/microblaze/brk.c +++ /dev/null @@ -1,42 +0,0 @@ -/* Copyright (C) 2011-2020 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library. If not, see - . */ - -#include -#include -#include - -/* This must be initialized data because commons can't have aliases. */ -void *__curbrk = 0; - -/* Old braindamage in GCC's crtstuff.c requires this symbol in an attempt - to work around different old braindamage in the old Linux ELF dynamic - linker. */ -weak_alias (__curbrk, ___brk_addr) - -int -__brk (void *addr) -{ - __curbrk = (void *) INTERNAL_SYSCALL_CALL (brk, addr); - if (__curbrk < addr) - { - __set_errno (ENOMEM); - return -1; - } - - return 0; -} -weak_alias (__brk, brk) diff --git a/sysdeps/unix/sysv/linux/microblaze/sysdep.h b/sysdeps/unix/sysv/linux/microblaze/sysdep.h index 6fd96adbf0..fb1e648b63 100644 --- a/sysdeps/unix/sysv/linux/microblaze/sysdep.h +++ b/sysdeps/unix/sysv/linux/microblaze/sysdep.h @@ -310,6 +310,9 @@ SYSCALL_ERROR_LABEL_DCL: \ # define SINGLE_THREAD_BY_GLOBAL 1 +#undef HAVE_INTERNAL_BRK_ADDR_SYMBOL +#define HAVE_INTERNAL_BRK_ADDR_SYMBOL 1 + #endif /* not __ASSEMBLER__ */ #endif /* _LINUX_MICROBLAZE_SYSDEP_H */ diff --git a/sysdeps/unix/sysv/linux/mips/brk.c b/sysdeps/unix/sysv/linux/mips/brk.c deleted file mode 100644 index 0335837948..0000000000 --- a/sysdeps/unix/sysv/linux/mips/brk.c +++ /dev/null @@ -1,46 +0,0 @@ -/* brk system call for Linux/MIPS. - Copyright (C) 2000-2020 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library. If not, see - . */ - -#include -#include -#include - -void *__curbrk = 0; - -/* Old braindamage in GCC's crtstuff.c requires this symbol in an attempt - to work around different old braindamage in the old Linux/x86 ELF - dynamic linker. Sigh. */ -weak_alias (__curbrk, ___brk_addr) - -int -__brk (void *addr) -{ - void *newbrk; - - newbrk = (void *) INTERNAL_SYSCALL_CALL (brk, addr); - __curbrk = newbrk; - - if (newbrk < addr) - { - __set_errno (ENOMEM); - return -1; - } - - return 0; -} -weak_alias (__brk, brk) diff --git a/sysdeps/unix/sysv/linux/mips/mips32/sysdep.h b/sysdeps/unix/sysv/linux/mips/mips32/sysdep.h index c5bcd90c25..49856c3249 100644 --- a/sysdeps/unix/sysv/linux/mips/mips32/sysdep.h +++ b/sysdeps/unix/sysv/linux/mips/mips32/sysdep.h @@ -43,6 +43,9 @@ #else /* ! __ASSEMBLER__ */ +#undef HAVE_INTERNAL_BRK_ADDR_SYMBOL +#define HAVE_INTERNAL_BRK_ADDR_SYMBOL 1 + /* Note that the original Linux syscall restart convention required the instruction immediately preceding SYSCALL to initialize $v0 with the syscall number. Then if a restart triggered, $v0 would have been diff --git a/sysdeps/unix/sysv/linux/mips/mips64/sysdep.h b/sysdeps/unix/sysv/linux/mips/mips64/sysdep.h index 1882fe4e73..73816816d5 100644 --- a/sysdeps/unix/sysv/linux/mips/mips64/sysdep.h +++ b/sysdeps/unix/sysv/linux/mips/mips64/sysdep.h @@ -41,6 +41,9 @@ #else /* ! __ASSEMBLER__ */ +#undef HAVE_INTERNAL_BRK_ADDR_SYMBOL +#define HAVE_INTERNAL_BRK_ADDR_SYMBOL 1 + #if _MIPS_SIM == _ABIN32 /* Convert X to a long long, without losing any bits if it is one already or warning if it is a 32-bit pointer. */ diff --git a/sysdeps/unix/sysv/linux/nios2/sysdep.h b/sysdeps/unix/sysv/linux/nios2/sysdep.h index 520c9460a2..51f736fb95 100644 --- a/sysdeps/unix/sysv/linux/nios2/sysdep.h +++ b/sysdeps/unix/sysv/linux/nios2/sysdep.h @@ -219,6 +219,9 @@ #define __SYSCALL_CLOBBERS "memory" +#undef HAVE_INTERNAL_BRK_ADDR_SYMBOL +#define HAVE_INTERNAL_BRK_ADDR_SYMBOL 1 + #endif /* __ASSEMBLER__ */ /* Pointer mangling support. */ diff --git a/sysdeps/unix/sysv/linux/pipe.c b/sysdeps/unix/sysv/linux/pipe.c index 0ea6ca5842..bc105ba6a7 100644 --- a/sysdeps/unix/sysv/linux/pipe.c +++ b/sysdeps/unix/sysv/linux/pipe.c @@ -26,7 +26,7 @@ int __pipe (int __pipedes[2]) { - return INLINE_SYSCALL_CALL (pipe2, __pipedes, 0); + return INLINE_SYSCALL_CALL (pipe2, (int *) __pipedes, 0); } libc_hidden_def (__pipe) weak_alias (__pipe, pipe) diff --git a/sysdeps/unix/sysv/linux/powerpc/dl-brk.S b/sysdeps/unix/sysv/linux/powerpc/dl-brk.S deleted file mode 100644 index eeb96544e3..0000000000 --- a/sysdeps/unix/sysv/linux/powerpc/dl-brk.S +++ /dev/null @@ -1 +0,0 @@ -#include diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc32/brk.S b/sysdeps/unix/sysv/linux/powerpc/powerpc32/brk.S deleted file mode 100644 index f3b960795e..0000000000 --- a/sysdeps/unix/sysv/linux/powerpc/powerpc32/brk.S +++ /dev/null @@ -1,52 +0,0 @@ -/* brk system call for Linux/ppc. - Copyright (C) 1995-2020 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, see - . */ - -#include -#define _ERRNO_H 1 -#include - - .comm __curbrk,4,4 - .section ".text" -ENTRY (__brk) - mflr r0 - stwu r1,-16(r1) - cfi_adjust_cfa_offset (16) - stw r3,8(r1) - stw r0,20(r1) - cfi_offset (lr, 4) - DO_CALL(SYS_ify(brk)) - lwz r6,8(r1) -#ifdef PIC - SETUP_GOT_ACCESS(r5,got_label) - addis r5,r5,__curbrk-got_label@ha - stw r3,__curbrk-got_label@l(r5) -#else - lis r4,__curbrk@ha - stw r3,__curbrk@l(r4) -#endif - lwz r0,20(r1) - cmplw r6,r3 - addi r1,r1,16 - mtlr r0 - li r3,0 - blelr+ - li r3,ENOMEM - b __syscall_error@local -END (__brk) - -weak_alias (__brk, brk) diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc64/brk.S b/sysdeps/unix/sysv/linux/powerpc/powerpc64/brk.S deleted file mode 100644 index f206909b72..0000000000 --- a/sysdeps/unix/sysv/linux/powerpc/powerpc64/brk.S +++ /dev/null @@ -1,43 +0,0 @@ -/* brk system call for Linux. PowerPC64 version. - Copyright (C) 1995-2020 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, see - . */ - -#include -#define _ERRNO_H 1 -#include - - .comm __curbrk,8,8 - .section ".toc","aw" -.LC__curbrk: - .tc __curbrk[TC],__curbrk - .section ".text" -ENTRY (__brk) - CALL_MCOUNT 1 - - std r3,-8(r1) - DO_CALL(SYS_ify(brk)) - ld r6,-8(r1) - ld r5,.LC__curbrk@toc(r2) - std r3,0(r5) - cmpld r6,r3 - li r3,0 - blelr+ - li r3,ENOMEM - TAIL_CALL_SYSCALL_ERROR -END (__brk) - -weak_alias (__brk, brk) diff --git a/sysdeps/unix/sysv/linux/riscv/sysdep.h b/sysdeps/unix/sysv/linux/riscv/sysdep.h index e94afbf106..37ff07a0d7 100644 --- a/sysdeps/unix/sysv/linux/riscv/sysdep.h +++ b/sysdeps/unix/sysv/linux/riscv/sysdep.h @@ -155,6 +155,9 @@ RV64). */ # define HAVE_GETCPU_VSYSCALL "__vdso_getcpu" +# undef HAVE_INTERNAL_BRK_ADDR_SYMBOL +# define HAVE_INTERNAL_BRK_ADDR_SYMBOL 1 + # define INTERNAL_SYSCALL(name, nr, args...) \ internal_syscall##nr (SYS_ify (name), args) diff --git a/sysdeps/unix/sysv/linux/s390/brk.c b/sysdeps/unix/sysv/linux/s390/brk.c deleted file mode 100644 index ca3a730f83..0000000000 --- a/sysdeps/unix/sysv/linux/s390/brk.c +++ /dev/null @@ -1,55 +0,0 @@ -/* - Copyright (C) 2000-2020 Free Software Foundation, Inc. - Contributed by Martin Schwidefsky (schwidefsky@de.ibm.com). - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, see - . */ - -#include -#include -#include - -void *__curbrk = 0; - -/* Old braindamage in GCC's crtstuff.c requires this symbol in an attempt - to work around different old braindamage in the old Linux/x86 ELF - dynamic linker. Sigh. */ -weak_alias (__curbrk, ___brk_addr) - -int -__brk (void *addr) -{ - void *newbrk; - - { - register void *__addr __asm__("2") = addr; - - __asm__ ("svc %b1\n\t" /* call sys_brk */ - : "=d" (__addr) - : "I" (SYS_ify(brk)), "r" (__addr) - : "cc", "memory" ); - newbrk = __addr; - } - __curbrk = newbrk; - - if (newbrk < addr) - { - __set_errno (ENOMEM); - return -1; - } - - return 0; -} -weak_alias (__brk, brk) diff --git a/sysdeps/unix/sysv/linux/s390/s390-32/sysdep.h b/sysdeps/unix/sysv/linux/s390/s390-32/sysdep.h index 26b0410cf3..26836620f2 100644 --- a/sysdeps/unix/sysv/linux/s390/s390-32/sysdep.h +++ b/sysdeps/unix/sysv/linux/s390/s390-32/sysdep.h @@ -175,6 +175,11 @@ #define ret_ERRVAL \ br 14 +#else + +# undef HAVE_INTERNAL_BRK_ADDR_SYMBOL +# define HAVE_INTERNAL_BRK_ADDR_SYMBOL 1 + #endif /* __ASSEMBLER__ */ /* Pointer mangling support. */ diff --git a/sysdeps/unix/sysv/linux/s390/s390-64/sysdep.h b/sysdeps/unix/sysv/linux/s390/s390-64/sysdep.h index 39831a2ec2..7211dadbfd 100644 --- a/sysdeps/unix/sysv/linux/s390/s390-64/sysdep.h +++ b/sysdeps/unix/sysv/linux/s390/s390-64/sysdep.h @@ -173,6 +173,11 @@ #define ret_ERRVAL \ br 14 +#else + +# undef HAVE_INTERNAL_BRK_ADDR_SYMBOL +# define HAVE_INTERNAL_BRK_ADDR_SYMBOL 1 + #endif /* __ASSEMBLER__ */ /* Pointer mangling support. */ diff --git a/sysdeps/unix/sysv/linux/sh/brk.c b/sysdeps/unix/sysv/linux/sh/brk.c deleted file mode 100644 index 5225d9bfc4..0000000000 --- a/sysdeps/unix/sysv/linux/sh/brk.c +++ /dev/null @@ -1,47 +0,0 @@ -/* brk system call for Linux/SH. - Copyright (C) 1999-2020 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, see - . */ - -#include -#include -#include - -/* This must be initialized data because commons can't have aliases. */ -void *__curbrk = 0; - -int -__brk (void *addr) -{ - void *newbrk; - register long r3 asm ("%r3") = SYS_ify (brk); - register long r4 asm ("%r4") = (long)addr; - - asm volatile ("trapa #0x11\n\t" SYSCALL_INST_PAD - : "=z"(newbrk) - : "r" (r3), "r" (r4)); - - __curbrk = newbrk; - - if (newbrk < addr) - { - __set_errno (ENOMEM); - return -1; - } - - return 0; -} -weak_alias (__brk, brk) diff --git a/sysdeps/unix/sysv/linux/sparc/sparc32/brk.c b/sysdeps/unix/sysv/linux/sparc/sparc32/brk.c deleted file mode 100644 index ba9a616f74..0000000000 --- a/sysdeps/unix/sysv/linux/sparc/sparc32/brk.c +++ /dev/null @@ -1,54 +0,0 @@ -/* brk system call for Linux/SPARC. - Copyright (C) 1995-2020 Free Software Foundation, Inc. - This file is part of the GNU C Library. - Contributed by Miguel de Icaza (miguel@nuclecu.unam.mx) - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, see - . */ - -#include -#include -#include - -/* This must be initialized data because commons can't have aliases. */ -void *__curbrk = 0; - -/* Old braindamage in GCC's crtstuff.c requires this symbol in an attempt - to work around different old braindamage in the old Linux ELF dynamic - linker. */ -weak_alias (__curbrk, ___brk_addr) - -int -__brk (void *addr) -{ - void *newbrk; - - { - register void *o0 __asm__("%o0") = addr; - register int g1 __asm__("%g1") = __NR_brk; - __asm ("t 0x10" : "=r"(o0) : "r"(g1), "0"(o0) : "cc"); - newbrk = o0; - } - - __curbrk = newbrk; - - if (newbrk < addr) - { - __set_errno (ENOMEM); - return -1; - } - - return 0; -} -weak_alias (__brk, brk) diff --git a/sysdeps/unix/sysv/linux/sparc/sparc32/sysdep.h b/sysdeps/unix/sysv/linux/sparc/sparc32/sysdep.h index 2c3754770b..018ee5781e 100644 --- a/sysdeps/unix/sysv/linux/sparc/sparc32/sysdep.h +++ b/sysdeps/unix/sysv/linux/sparc/sparc32/sysdep.h @@ -121,6 +121,9 @@ ENTRY(name); \ "f24", "f25", "f26", "f27", "f28", "f29", "f30", "f31", \ "cc", "memory" +#undef HAVE_INTERNAL_BRK_ADDR_SYMBOL +#define HAVE_INTERNAL_BRK_ADDR_SYMBOL 1 + #endif /* __ASSEMBLER__ */ /* Pointer mangling support. */ diff --git a/sysdeps/unix/sysv/linux/sparc/sparc64/brk.S b/sysdeps/unix/sysv/linux/sparc/sparc64/brk.S deleted file mode 100644 index 471da3d268..0000000000 --- a/sysdeps/unix/sysv/linux/sparc/sparc64/brk.S +++ /dev/null @@ -1,104 +0,0 @@ -/* Copyright (C) 1997-2020 Free Software Foundation, Inc. - This file is part of the GNU C Library. - Contributed by Richard Henderson , 1997. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, see - . */ - -/* __brk is a special syscall under Linux since it never returns an - error. Instead, the error condition is indicated by returning the old - break value (instead of the new, requested one). */ - -#include -#include - -#ifdef PIC -.section .bss - .align 8 - .globl __curbrk -__curbrk: .skip 8 - .type __curbrk,@object - .size __curbrk,8 -#else -.common __curbrk, 8, 8 -#endif - - .text -ENTRY (__brk) - save %sp, -192, %sp - cfi_def_cfa_register(%fp) - cfi_window_save - cfi_register(%o7, %i7) -#ifdef PIC - SETUP_PIC_REG(l7) -#endif - - LOADSYSCALL(brk) - mov %i0, %o0 - - ta 0x6d - - /* All the ways we can fail... */ - bcs,pn %xcc, .Lerr1 - nop - brz,pt %i0, .Lok - subcc %i0, %o0, %g0 - bne,pn %xcc, .Lerr0 - nop - - /* Update __curbrk and return cleanly. */ -.Lok: -#ifndef PIC - sethi %hi(__curbrk), %g1 - or %g1, %lo(__curbrk), %g1 -#else - sethi %gdop_hix22(__curbrk), %g1 - xor %g1, %gdop_lox10(__curbrk), %g1 - ldx [%l7 + %g1], %g1, %gdop(__curbrk) -#endif - stx %o0, [%g1] - mov %g0, %i0 - - /* Don't use "ret" cause the preprocessor will eat it. */ - jmpl %i7+8, %g0 - restore - - /* What a horrible way to die. */ -.Lerr0: set ENOMEM, %o0 -.Lerr1: -#ifndef _LIBC_REENTRANT -#ifndef PIC - sethi %hi(errno), %g1 - or %g1, %lo(errno), %g1 -#else - sethi %gdop_hix22(errno), %g1 - xor %g1, %gdop_lox10(errno), %g1 - ldx [%l7 + %g1], %g1, %gdop(errno) -#endif - st %o0, [%g1] -#else -#if IS_IN (libc) - call HIDDEN_JUMPTARGET(__errno_location) -#else - call __errno_location -#endif - mov %o0,%l1 - st %l1, [%o0] -#endif - sub %g0, 1, %i0 - jmpl %i7+8, %g0 - restore -END (__brk) - -weak_alias (__brk, brk) diff --git a/sysdeps/unix/sysv/linux/sparc/sparc64/dl-brk.S b/sysdeps/unix/sysv/linux/sparc/sparc64/dl-brk.S deleted file mode 100644 index eeb96544e3..0000000000 --- a/sysdeps/unix/sysv/linux/sparc/sparc64/dl-brk.S +++ /dev/null @@ -1 +0,0 @@ -#include diff --git a/sysdeps/unix/sysv/linux/sysdep.h b/sysdeps/unix/sysv/linux/sysdep.h index 71ecc19cd5..736cf52697 100644 --- a/sysdeps/unix/sysv/linux/sysdep.h +++ b/sysdeps/unix/sysv/linux/sysdep.h @@ -99,4 +99,8 @@ it missing due the usage of a old generic version without it). */ #define HAVE_INTERNAL_SEND_SYMBOL 1 +/* Export the ___brk_addr symbol on brk.c implementation (some ABIs export + it due and old crtstuff.c code). */ +#define HAVE_INTERNAL_BRK_ADDR_SYMBOL 0 + #endif /* _SYSDEP_LINUX_H */ diff --git a/sysdeps/unix/sysv/linux/x86_64/brk.c b/sysdeps/unix/sysv/linux/x86_64/brk.c deleted file mode 100644 index fba9278c68..0000000000 --- a/sysdeps/unix/sysv/linux/x86_64/brk.c +++ /dev/null @@ -1,41 +0,0 @@ -/* brk system call for Linux/x86_64. - Copyright (C) 1995-2020 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, see - . */ - -#include -#include -#include - -/* This must be initialized data because commons can't have aliases. */ -void *__curbrk = 0; - -int -__brk (void *addr) -{ - void *newbrk; - - __curbrk = newbrk = (void *) INLINE_SYSCALL (brk, 1, addr); - - if (newbrk < addr) - { - __set_errno (ENOMEM); - return -1; - } - - return 0; -} -weak_alias (__brk, brk) From patchwork Wed Nov 18 19:55:51 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adhemerval Zanella Netto X-Patchwork-Id: 41125 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id C1EAE3948A7B; Wed, 18 Nov 2020 19:56:40 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org C1EAE3948A7B DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1605729400; bh=wj237K5xkWyeVO9NgelQhMq79ZEQQgQYob+9egZQy/M=; h=To:Subject:Date:In-Reply-To:References:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=DU42DoQFZuAGIxnLJXDTuA6dajYqTYAMAgU5v/MloOHeIoIFArAJl2tB8eKBLYfz0 Xrj351QlSxF75twDVr4Dp7slAhmf3lhsxuPNP43qEqKln3Xu1eDeWo9ZJspTilq4+O e+3qEVw9Z34nPmR6XZGvFR9cCKCC/Y9TkjYWkRLQ= X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from mail-qv1-xf31.google.com (mail-qv1-xf31.google.com [IPv6:2607:f8b0:4864:20::f31]) by sourceware.org (Postfix) with ESMTPS id 07F3B394847E for ; Wed, 18 Nov 2020 19:56:37 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 07F3B394847E Received: by mail-qv1-xf31.google.com with SMTP id u23so1680673qvf.1 for ; Wed, 18 Nov 2020 11:56:37 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=wj237K5xkWyeVO9NgelQhMq79ZEQQgQYob+9egZQy/M=; b=QiiGibrpZPmgJluuYElTVTe/B2D3BhsjOUkYeKSzj3BbI+B6Eb0a3J65ObSbHF7sA5 2q9N1AxzbYV/j4x/5LNTGgJv7enUkc2vLtyk7eM7VdaTX47OCsZtzpOglDItla+E+ePB 9QzzgVZ9Z6jE1WPKR7SOWcNaMSZSncj/Peyeqq6hvqN/8GEXghHqKux5rcJ6FCQrF9PL Pwr0Qs+VlwoobwLHrlQcj8368GqwG8aOZTJTID9pj0dHj8EcRv7/F6aMmzAMrDk5vsbD LVHQfB/2mDZ8e+/9ZPTfSGQbN/ykQzu48+4unJxkBMg3qASJUcxBN5ZeRSfGi2N0Evke Jl0Q== X-Gm-Message-State: AOAM5306U7qgLIVaFAXvMRNZMn0j5zQ20S7ZEQptPHNUA4ZEufKjhGC9 Iwzw3dSGtG2ROz7bgSNcF3GYqjTCFdm5mA== X-Google-Smtp-Source: ABdhPJygSMufUpo1ldX/v3K2oLoL2HBdp1bFjinAXh0FDpLn+A09WRhz6r3xQ6v+k2VanO5itbTR0w== X-Received: by 2002:a0c:aed2:: with SMTP id n18mr6571631qvd.4.1605729396002; Wed, 18 Nov 2020 11:56:36 -0800 (PST) Received: from localhost.localdomain ([177.194.48.209]) by smtp.googlemail.com with ESMTPSA id f27sm6538775qtv.95.2020.11.18.11.56.34 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 18 Nov 2020 11:56:35 -0800 (PST) To: libc-alpha@sourceware.org Subject: [PATCH 27/28] linux: Add generic C syscall implementation Date: Wed, 18 Nov 2020 16:55:51 -0300 Message-Id: <20201118195552.2687336-28-adhemerval.zanella@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20201118195552.2687336-1-adhemerval.zanella@linaro.org> References: <20201118195552.2687336-1-adhemerval.zanella@linaro.org> MIME-Version: 1.0 X-Spam-Status: No, score=-13.9 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, KAM_SHORT, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Adhemerval Zanella via Libc-alpha From: Adhemerval Zanella Netto Reply-To: Adhemerval Zanella Errors-To: libc-alpha-bounces@sourceware.org Sender: "Libc-alpha" The hppa and riscv one are also removed. The riscv specially is abusing the internal interfaces by defining it with a different signature. If the idea is to provide an optimized version a better alternative would be to provide an assembly one as other architectures. Checked on x86_64-linux-gnu and with build for the affected ABIs. --- sysdeps/unix/sysv/linux/hppa/syscall.c | 65 ------------------- sysdeps/unix/sysv/linux/{riscv => }/syscall.c | 33 ++++++---- 2 files changed, 20 insertions(+), 78 deletions(-) delete mode 100644 sysdeps/unix/sysv/linux/hppa/syscall.c rename sysdeps/unix/sysv/linux/{riscv => }/syscall.c (53%) diff --git a/sysdeps/unix/sysv/linux/hppa/syscall.c b/sysdeps/unix/sysv/linux/hppa/syscall.c deleted file mode 100644 index 7f6794b09f..0000000000 --- a/sysdeps/unix/sysv/linux/hppa/syscall.c +++ /dev/null @@ -1,65 +0,0 @@ -/* Copyright (C) 1997-2020 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library. If not, see - . */ - -#include -#include -#include - -/* HPPA implements syscall() in 'C'; the assembler version would - typically be in syscall.S. Also note that we have INLINE_SYSCALL, - INTERNAL_SYSCALL, and all the generated pure assembly syscall wrappers. - How often the function is used is unknown. */ - -long int -syscall (long int __sysno, ...) -{ - /* FIXME: Keep this matching INLINE_SYSCALL for hppa */ - va_list args; - long int arg0, arg1, arg2, arg3, arg4, arg5; - long int __sys_res; - - /* Load varargs */ - va_start (args, __sysno); - arg0 = va_arg (args, long int); - arg1 = va_arg (args, long int); - arg2 = va_arg (args, long int); - arg3 = va_arg (args, long int); - arg4 = va_arg (args, long int); - arg5 = va_arg (args, long int); - va_end (args); - - { - LOAD_ARGS_6 (arg0, arg1, arg2, arg3, arg4, arg5) - register unsigned long int __res asm("r28"); - PIC_REG_DEF - LOAD_REGS_6 - asm volatile (SAVE_ASM_PIC - " ble 0x100(%%sr2, %%r0) \n" - " copy %1, %%r20 \n" - LOAD_ASM_PIC - : "=r" (__res) - : "r" (__sysno) PIC_REG_USE ASM_ARGS_6 - : "memory", CALL_CLOB_REGS CLOB_ARGS_6); - __sys_res = __res; - } - if ((unsigned long int) __sys_res >= (unsigned long int) -4095) - { - __set_errno (-__sys_res); - __sys_res = -1; - } - return __sys_res; -} diff --git a/sysdeps/unix/sysv/linux/riscv/syscall.c b/sysdeps/unix/sysv/linux/syscall.c similarity index 53% rename from sysdeps/unix/sysv/linux/riscv/syscall.c rename to sysdeps/unix/sysv/linux/syscall.c index a99375c054..2e39ed9bc9 100644 --- a/sysdeps/unix/sysv/linux/riscv/syscall.c +++ b/sysdeps/unix/sysv/linux/syscall.c @@ -1,5 +1,5 @@ -/* system call interface. Linux/RISC-V version. - Copyright (C) 2001-2020 Free Software Foundation, Inc. +/* Indirect system call. Linux version. + Copyright (C) 2020 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -16,19 +16,26 @@ License along with the GNU C Library. If not, see . */ +#include #include long int -syscall (long int syscall_number, long int arg1, long int arg2, long int arg3, - long int arg4, long int arg5, long int arg6, long int arg7) +syscall (long int number, ...) { - long int ret; - - ret = INTERNAL_SYSCALL_NCS (syscall_number, 7, arg1, arg2, arg3, arg4, - arg5, arg6, arg7); - - if (INTERNAL_SYSCALL_ERROR_P (ret)) - return __syscall_error (ret); - - return ret; + va_list args; + + va_start (args, number); + long int arg0 = va_arg (args, long int); + long int arg1 = va_arg (args, long int); + long int arg2 = va_arg (args, long int); + long int arg3 = va_arg (args, long int); + long int arg4 = va_arg (args, long int); + long int arg5 = va_arg (args, long int); + va_end (args); + + long int ret = INTERNAL_SYSCALL_NCS (number, 6, arg0, arg1, arg2, + arg3, arg4, arg5); + return INTERNAL_SYSCALL_ERROR_P (ret) + ? SYSCALL_ERROR_LABEL (INTERNAL_SYSCALL_ERRNO (ret)) + : ret; } From patchwork Wed Nov 18 19:55:52 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adhemerval Zanella Netto X-Patchwork-Id: 41127 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id D8331394B01F; Wed, 18 Nov 2020 19:56:42 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org D8331394B01F DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1605729402; bh=qf6kb9Hw2TbDJsoU56DF7i9oYonfRTGY0GBJXK7Y1Uc=; h=To:Subject:Date:In-Reply-To:References:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=d4Q8IAPSttwFpdRJjNWk4UBZWPUTQP3Wy2LpDmI3Amji8FrtexfmmHCSZjK7KG2g3 ueHtmZZJ6NT8gUAfi86LMgJThazO5JeFUucaZwEyYXs68F4osUv9qYp4rjiaiSFaU+ tGLHrGaTZOiXuFe6vnHRXO6E5w37Y/XiVHbL/MQc= X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from mail-qv1-xf34.google.com (mail-qv1-xf34.google.com [IPv6:2607:f8b0:4864:20::f34]) by sourceware.org (Postfix) with ESMTPS id 942F03948A7B for ; Wed, 18 Nov 2020 19:56:38 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 942F03948A7B Received: by mail-qv1-xf34.google.com with SMTP id ec16so1694098qvb.0 for ; Wed, 18 Nov 2020 11:56:38 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=qf6kb9Hw2TbDJsoU56DF7i9oYonfRTGY0GBJXK7Y1Uc=; b=GWkqMDybjSiRz1q4iSA4PmkJzL4O6Sn/loTNR0wXFbAYQvzFy0pOZxM9HDuW2V3AEi rrN6ygPZjxqRoAWz1ghwHlGiHGQfbuHAPa+6L/XVLc89vBv4HWnDbOYwdJBVdfjTTGHF fugwhFY4g1I+vaxQN4G7UOlDIiWK6N86HfDFjULgRJCfJaozUGIij2qFATySJR5tOiLy E61Zq3g0esdjg4QhHQT+svKlTnJ6BdJCSBiXq4GlJzGBC1MNjYabm5fWQCgSKHlDEGIp TldtJh7Ij7Lyj07hhS/3awfcLaAH8oGq+XoWGeaqNxpYgirCZuf809GpMPRgMAUcikAF kStQ== X-Gm-Message-State: AOAM532oQIM0iFSZByg12RmSeohmn7o0vY1OOqkldFqJaZ8tJxxyI9/n yyDrRx7Uy9BGWYLz/jUBRyXA8Hg2KkvUNA== X-Google-Smtp-Source: ABdhPJyMEnTUvKW6J/g7aImgglNixl3pOctiuc1r/DKfraBmn3SCZZyjqO9MOFY5IKvUCnPshSK0Og== X-Received: by 2002:a0c:bda2:: with SMTP id n34mr6463369qvg.28.1605729397654; Wed, 18 Nov 2020 11:56:37 -0800 (PST) Received: from localhost.localdomain ([177.194.48.209]) by smtp.googlemail.com with ESMTPSA id f27sm6538775qtv.95.2020.11.18.11.56.36 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 18 Nov 2020 11:56:37 -0800 (PST) To: libc-alpha@sourceware.org Subject: [PATCH 28/28] alpha: Move implementations to C Date: Wed, 18 Nov 2020 16:55:52 -0300 Message-Id: <20201118195552.2687336-29-adhemerval.zanella@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20201118195552.2687336-1-adhemerval.zanella@linaro.org> References: <20201118195552.2687336-1-adhemerval.zanella@linaro.org> MIME-Version: 1.0 X-Spam-Status: No, score=-13.9 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, KAM_SHORT, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Adhemerval Zanella via Libc-alpha From: Adhemerval Zanella Netto Reply-To: Adhemerval Zanella Errors-To: libc-alpha-bounces@sourceware.org Sender: "Libc-alpha" Move alpha specific the feraiseexcept, getegid, geteuid, getppid, eee_get_fp_control, ieee_set_fp_control, and setcontext to C implementations. Checked on alpha-linux-gnu. --- .../alpha/{fraiseexcpt.S => fraiseexcpt.c} | 37 ++++------------ .../sysv/linux/alpha/{getegid.S => getegid.c} | 15 ++++--- .../sysv/linux/alpha/{geteuid.S => geteuid.c} | 15 ++++--- .../sysv/linux/alpha/{getppid.S => getppid.c} | 15 ++++--- ...get_fp_control.S => ieee_get_fp_control.c} | 43 ++++++------------- ...set_fp_control.S => ieee_set_fp_control.c} | 35 ++++----------- .../alpha/{setcontext.S => setcontext.c} | 27 ++++++------ sysdeps/unix/sysv/linux/alpha/sysdep.h | 21 +++++++++ 8 files changed, 87 insertions(+), 121 deletions(-) rename sysdeps/unix/sysv/linux/alpha/{fraiseexcpt.S => fraiseexcpt.c} (66%) rename sysdeps/unix/sysv/linux/alpha/{getegid.S => getegid.c} (79%) rename sysdeps/unix/sysv/linux/alpha/{geteuid.S => geteuid.c} (79%) rename sysdeps/unix/sysv/linux/alpha/{getppid.S => getppid.c} (79%) rename sysdeps/unix/sysv/linux/alpha/{ieee_get_fp_control.S => ieee_get_fp_control.c} (61%) rename sysdeps/unix/sysv/linux/alpha/{ieee_set_fp_control.S => ieee_set_fp_control.c} (62%) rename sysdeps/unix/sysv/linux/alpha/{setcontext.S => setcontext.c} (62%) diff --git a/sysdeps/unix/sysv/linux/alpha/fraiseexcpt.S b/sysdeps/unix/sysv/linux/alpha/fraiseexcpt.c similarity index 66% rename from sysdeps/unix/sysv/linux/alpha/fraiseexcpt.S rename to sysdeps/unix/sysv/linux/alpha/fraiseexcpt.c index 8c4b933749..903eaebb66 100644 --- a/sysdeps/unix/sysv/linux/alpha/fraiseexcpt.S +++ b/sysdeps/unix/sysv/linux/alpha/fraiseexcpt.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2004-2020 Free Software Foundation, Inc. +/* Copyright (C) 2020 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -15,37 +15,16 @@ License along with the GNU C Library. If not, see . */ +#include #include #include "kernel_sysinfo.h" - - .text - -ENTRY(__feraiseexcept) - cfi_startproc - PSEUDO_PROLOGUE - - lda sp, -16(sp) - cfi_adjust_cfa_offset(16) - - ldi v0, __NR_osf_setsysinfo - stq a0, 0(sp) - mov sp, a1 - ldi a0, SSI_IEEE_RAISE_EXCEPTION - call_pal PAL_callsys - - lda sp, 16(sp) - cfi_adjust_cfa_offset(-16) - - /* Here in libm we can't use SYSCALL_ERROR_LABEL. Nor is it clear - that we'd want to set errno anyway. All we're required to do is - return non-zero on error. Which is exactly A3. */ - mov a3, v0 - ret - -END(__feraiseexcept) - cfi_endproc - +int +__feraiseexcept (int excepts) +{ + return -INTERNAL_SYSCALL_CALL (osf_setsysinfo, SSI_IEEE_RAISE_EXCEPTION, + &excepts, 0, 0, 0); +} #if IS_IN (libm) # include # if SHLIB_COMPAT (libm, GLIBC_2_1, GLIBC_2_2) diff --git a/sysdeps/unix/sysv/linux/alpha/getegid.S b/sysdeps/unix/sysv/linux/alpha/getegid.c similarity index 79% rename from sysdeps/unix/sysv/linux/alpha/getegid.S rename to sysdeps/unix/sysv/linux/alpha/getegid.c index 72a941210a..9aeccd5ba9 100644 --- a/sysdeps/unix/sysv/linux/alpha/getegid.S +++ b/sysdeps/unix/sysv/linux/alpha/getegid.c @@ -1,4 +1,5 @@ -/* Copyright (C) 1991-2020 Free Software Foundation, Inc. +/* Get effective group identity. Linux/Alpha. + Copyright (C) 2020 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -15,12 +16,12 @@ License along with the GNU C Library. If not, see . */ +#include #include - -PSEUDO (__getegid, getxgid, 0) - MOVE (r1, r0) - ret -PSEUDO_END (__getegid) - +gid_t +__getegid (void) +{ + return __internal_syscall_pair (__NR_getxgid).sc_20; +} weak_alias (__getegid, getegid) diff --git a/sysdeps/unix/sysv/linux/alpha/geteuid.S b/sysdeps/unix/sysv/linux/alpha/geteuid.c similarity index 79% rename from sysdeps/unix/sysv/linux/alpha/geteuid.S rename to sysdeps/unix/sysv/linux/alpha/geteuid.c index a6db15d55c..63d73ac5d1 100644 --- a/sysdeps/unix/sysv/linux/alpha/geteuid.S +++ b/sysdeps/unix/sysv/linux/alpha/geteuid.c @@ -1,4 +1,5 @@ -/* Copyright (C) 1991-2020 Free Software Foundation, Inc. +/* Get effective user identity. Linux/Alpha. + Copyright (C) 2020 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -15,12 +16,12 @@ License along with the GNU C Library. If not, see . */ +#include #include - -PSEUDO (__geteuid, getxuid, 0) - MOVE (r1, r0) - ret -PSEUDO_END (__geteuid) - +uid_t +__geteuid (void) +{ + return __internal_syscall_pair (__NR_getxuid).sc_20; +} weak_alias (__geteuid, geteuid) diff --git a/sysdeps/unix/sysv/linux/alpha/getppid.S b/sysdeps/unix/sysv/linux/alpha/getppid.c similarity index 79% rename from sysdeps/unix/sysv/linux/alpha/getppid.S rename to sysdeps/unix/sysv/linux/alpha/getppid.c index ae5cfc03aa..968b2a96a7 100644 --- a/sysdeps/unix/sysv/linux/alpha/getppid.S +++ b/sysdeps/unix/sysv/linux/alpha/getppid.c @@ -1,4 +1,5 @@ -/* Copyright (C) 1991-2020 Free Software Foundation, Inc. +/* Get parent process identification. Linux/Alpha. + Copyright (C) 2020 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -15,12 +16,12 @@ License along with the GNU C Library. If not, see . */ +#include #include - -PSEUDO (__getppid, getxpid, 0) - MOVE (r1, r0) - ret -PSEUDO_END (__getppid) - +pid_t +__getppid (void) +{ + return __internal_syscall_pair (__NR_getxpid).sc_20; +} weak_alias (__getppid, getppid) diff --git a/sysdeps/unix/sysv/linux/alpha/ieee_get_fp_control.S b/sysdeps/unix/sysv/linux/alpha/ieee_get_fp_control.c similarity index 61% rename from sysdeps/unix/sysv/linux/alpha/ieee_get_fp_control.S rename to sysdeps/unix/sysv/linux/alpha/ieee_get_fp_control.c index 72c2fbfc10..44e467f927 100644 --- a/sysdeps/unix/sysv/linux/alpha/ieee_get_fp_control.S +++ b/sysdeps/unix/sysv/linux/alpha/ieee_get_fp_control.c @@ -1,6 +1,5 @@ -/* Copyright (C) 1993-2020 Free Software Foundation, Inc. +/* Copyright (C) 2020 Free Software Foundation, Inc. This file is part of the GNU C Library. - Contributed by David Mosberger , 1995. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public @@ -16,35 +15,19 @@ License along with the GNU C Library. If not, see . */ +#include #include #include "kernel_sysinfo.h" - - .text - -ENTRY(__ieee_get_fp_control) - cfi_startproc - PSEUDO_PROLOGUE - - lda sp, -16(sp) - cfi_adjust_cfa_offset(16) - - mov sp, a1 - ldi a0, GSI_IEEE_FP_CONTROL - ldi v0, __NR_osf_getsysinfo - call_pal PAL_callsys - - ldq t0, 0(sp) - lda sp, 16(sp) - cfi_adjust_cfa_offset(-16) - - bne a3, SYSCALL_ERROR_LABEL - - mov t0, v0 - ret - -PSEUDO_END(__ieee_get_fp_control) - cfi_endproc - -libc_hidden_def(__ieee_get_fp_control) +unsigned long int +__ieee_get_fp_control (void) +{ + unsigned long int env; + int r = INLINE_SYSCALL_CALL (osf_getsysinfo, GSI_IEEE_FP_CONTROL, &env, 0, + 0, 0); + if (r != 0) + return r; + return env; +} +libc_hidden_def (__ieee_get_fp_control) weak_alias (__ieee_get_fp_control, ieee_get_fp_control) diff --git a/sysdeps/unix/sysv/linux/alpha/ieee_set_fp_control.S b/sysdeps/unix/sysv/linux/alpha/ieee_set_fp_control.c similarity index 62% rename from sysdeps/unix/sysv/linux/alpha/ieee_set_fp_control.S rename to sysdeps/unix/sysv/linux/alpha/ieee_set_fp_control.c index 9e80346b3e..0a85ff1b64 100644 --- a/sysdeps/unix/sysv/linux/alpha/ieee_set_fp_control.S +++ b/sysdeps/unix/sysv/linux/alpha/ieee_set_fp_control.c @@ -1,6 +1,5 @@ -/* Copyright (C) 1993-2020 Free Software Foundation, Inc. +/* Copyright (C) 2020 Free Software Foundation, Inc. This file is part of the GNU C Library. - Contributed by David Mosberger , 1995. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public @@ -16,31 +15,15 @@ License along with the GNU C Library. If not, see . */ +#include #include #include "kernel_sysinfo.h" - -ENTRY(__ieee_set_fp_control) - cfi_startproc - PSEUDO_PROLOGUE - - lda sp, -16(sp) - cfi_adjust_cfa_offset(16) - - ldi v0, __NR_osf_setsysinfo - stq a0, 0(sp) - mov sp, a1 - ldi a0, SSI_IEEE_FP_CONTROL - call_pal PAL_callsys - - lda sp, 16(sp) - cfi_adjust_cfa_offset(-16) - - bne a3, SYSCALL_ERROR_LABEL - ret - -PSEUDO_END(__ieee_set_fp_control) - cfi_endproc - -libc_hidden_def(__ieee_set_fp_control) +void +__ieee_set_fp_control (unsigned long int env) +{ + INLINE_SYSCALL_CALL (osf_setsysinfo, SSI_IEEE_FP_CONTROL, &env, 0, + 0, 0); +} +libc_hidden_def (__ieee_set_fp_control) weak_alias (__ieee_set_fp_control, ieee_set_fp_control) diff --git a/sysdeps/unix/sysv/linux/alpha/setcontext.S b/sysdeps/unix/sysv/linux/alpha/setcontext.c similarity index 62% rename from sysdeps/unix/sysv/linux/alpha/setcontext.S rename to sysdeps/unix/sysv/linux/alpha/setcontext.c index 734f3d5109..4478bef26b 100644 --- a/sysdeps/unix/sysv/linux/alpha/setcontext.S +++ b/sysdeps/unix/sysv/linux/alpha/setcontext.c @@ -1,5 +1,5 @@ -/* Install given context. - Copyright (C) 2004-2020 Free Software Foundation, Inc. +/* Set the user context. Linux/Alpha version. + Copyright (C) 2020 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -16,19 +16,16 @@ License along with the GNU C Library. If not, see . */ +#include #include -#include - -/* In case the user fiddled it, copy the "official" signal mask - from the ucontext_t into the sigcontext structure. */ -#undef PSEUDO_PREPARE_ARGS -#define PSEUDO_PREPARE_ARGS \ - ldq $0, UC_SIGMASK($16); \ - stq $0, UC_SIGCTX+SC_MASK($16); \ - lda $16, UC_SIGCTX($16); - -PSEUDO(__setcontext, sigreturn, 1) - ret -PSEUDO_END(__setcontext) +int +__setcontext (const ucontext_t *ucp) +{ + /* In case the user fiddled it, copy the "official" signal mask + from the ucontext_t into the sigcontext structure. */ + ucontext_t *ucp_noconst = (ucontext_t *) ucp; + ucp_noconst->uc_mcontext.sc_mask = *((long int *)&ucp_noconst->uc_sigmask); + return INLINE_SYSCALL_CALL (sigreturn, &ucp->uc_mcontext); +} weak_alias (__setcontext, setcontext) diff --git a/sysdeps/unix/sysv/linux/alpha/sysdep.h b/sysdeps/unix/sysv/linux/alpha/sysdep.h index 7daf445068..6d5458e2d8 100644 --- a/sysdeps/unix/sysv/linux/alpha/sysdep.h +++ b/sysdeps/unix/sysv/linux/alpha/sysdep.h @@ -314,6 +314,27 @@ __LABEL(name) \ : : internal_syscall_clobbers); \ _sc_19 != 0 ? -_sc_0 : _sc_0; \ }) + +struct pair_t +{ + long int sc_0; + long int sc_20; +}; + +static inline struct pair_t +__internal_syscall_pair (long int name) +{ + register long int sc_19 asm ("$19"); + register long int sc_20 asm ("$20"); + register long int sc_0 = name; + asm volatile ("callsys # %0 %1 <= %2" + : "+v" (sc_0), "=r" (sc_19), "=r" (sc_20) + : + : internal_syscall_clobbers, + "$16", "$17", "$18", "$21"); + return (struct pair_t) { sc_0, sc_20 }; +} + #endif /* ASSEMBLER */ /* Pointer mangling support. Note that tls access is slow enough that