From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: AS3215 2.6.0.0/16 X-Spam-Status: No, score=-5.8 required=3.0 tests=AWL,BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI,NICE_REPLY_A, RCVD_IN_DNSWL_MED,SPF_HELO_PASS,SPF_PASS shortcircuit=no autolearn=ham autolearn_force=no version=3.4.2 Received: from sourceware.org (server2.sourceware.org [IPv6:2620:52:3:1:0:246e:9693:128c]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by dcvr.yhbt.net (Postfix) with ESMTPS id 8659B1F953 for ; Tue, 30 Nov 2021 11:52:24 +0000 (UTC) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 9A3803857C67 for ; Tue, 30 Nov 2021 11:52:22 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 9A3803857C67 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1638273142; bh=PBNl4diiB23TCgGmqjB6s+m3euydZTnbLWDiy3bE3KQ=; h=Date:Subject:To:References:In-Reply-To:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc: From; b=fHgFjS+z7TG0/6WyP1Y66iijR+RDMDC7XoV2lj3psWCL6z2EJvsZYFm4pMZGNhv0N kRcDMErFZL5Xuf8xlZz7iHJyNU4jTV6MgasxuirV9yOLdUD2MdDiQECp8q3GgzDeoM VsxnAAAa6tUQb+1e+Q/7UO9jwntd7RnxQImG89GU= Received: from mail-ua1-x92b.google.com (mail-ua1-x92b.google.com [IPv6:2607:f8b0:4864:20::92b]) by sourceware.org (Postfix) with ESMTPS id 14A663858C2C for ; Tue, 30 Nov 2021 11:52:02 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 14A663858C2C Received: by mail-ua1-x92b.google.com with SMTP id p2so40661597uad.11 for ; Tue, 30 Nov 2021 03:52:02 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:date:mime-version:user-agent:subject :content-language:to:cc:references:from:in-reply-to :content-transfer-encoding; bh=PBNl4diiB23TCgGmqjB6s+m3euydZTnbLWDiy3bE3KQ=; b=0eo4BbVV+fPiNnhHIm4ari0AFTh7txMRKSk9PD2FajuHLRk6IrLgXWUKVD1+9FTGTB lszIyjbSuaiiGOJC+E8p44Tcg/hgSwesQ6j0Lob80RHLpO/JVJfRbz0AN4eiBjF9hfh3 LuNRPV0gChR93B1QfQsPYjAX+Da0TQFnoFeVRyzKe1m++bmgWR9VX0Pnpy0BzgA3QuCr AATH6rf4wFT++p/4+w9vMHrMD4Kx7sYUTfNPoOOC3paWdHRDkm1tfc0RqJCoZ+AbFBe7 YUA0qFaoO6Hm2pFCyV5MBe6cwmd6foicwJXLoQTIknOdWWdB5MoVdcI3wHrhERFjWJl9 AEHA== X-Gm-Message-State: AOAM533ZHja0VXOHmAlgdd0Te1uUxirALe1h8ES5L+KjU3HCY8zTDWm0 05RG4VqpS7m/9168aDhQQr98j9XOyyJRqA== X-Google-Smtp-Source: ABdhPJwqIP/lqWgC0MZSE1mlm7Y5mrm9rWAy7XDhO4ea0C5dmz8QKnYqi8Ls5Xd15d89L5SdQHPb8A== X-Received: by 2002:a67:f88e:: with SMTP id h14mr39472332vso.37.1638273121478; Tue, 30 Nov 2021 03:52:01 -0800 (PST) Received: from ?IPV6:2804:431:c7cb:30f8:6601:a360:bcd5:8568? ([2804:431:c7cb:30f8:6601:a360:bcd5:8568]) by smtp.gmail.com with ESMTPSA id p130sm9790047vke.56.2021.11.30.03.52.00 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 30 Nov 2021 03:52:01 -0800 (PST) Message-ID: <5e0b865f-8193-a0eb-19cb-169e7913bf19@linaro.org> Date: Tue, 30 Nov 2021 08:51:59 -0300 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.3.2 Subject: Re: [PATCH 2/6] linux: Add prlimit64 C implementation Content-Language: en-US To: Stafford Horne References: <20211122185437.1934590-1-adhemerval.zanella@linaro.org> <20211122185437.1934590-3-adhemerval.zanella@linaro.org> In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit 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: , From: Adhemerval Zanella via Libc-alpha Reply-To: Adhemerval Zanella Cc: libc-alpha@sourceware.org Errors-To: libc-alpha-bounces+e=80x24.org@sourceware.org Sender: "Libc-alpha" On 25/11/2021 20:39, Stafford Horne wrote: > On Mon, Nov 22, 2021 at 03:54:33PM -0300, Adhemerval Zanella wrote: >> 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 | 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 | 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 | 1 - >> 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(+), 27 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/mips/mips32/syscalls.list >> create mode 100644 sysdeps/unix/sysv/linux/prlimit64.c >> diff --git a/sysdeps/unix/sysv/linux/prlimit.c b/sysdeps/unix/sysv/linux/prlimit.c >> index c12de52693..f9d9911a04 100644 >> --- a/sysdeps/unix/sysv/linux/prlimit.c >> +++ b/sysdeps/unix/sysv/linux/prlimit.c >> @@ -18,6 +18,7 @@ >> #include >> #include > > Possibly a comment here saying something like. > > /* For ports that support the 64-bit ABI we do not need to define prlimit > and instead prlimit aliases to prlimit64. See the prlimit64 > implementation. */ It is kinda implicit for other LFS aliais, but the extra comment is helpful. Ack. > >> +#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. > > 2021. Ack. > >> + 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 8e9b7c4b71..91d78d91ef 100644 >> --- a/sysdeps/unix/sysv/linux/s390/s390-32/syscalls.list >> +++ b/sysdeps/unix/sysv/linux/s390/s390-32/syscalls.list >> @@ -15,5 +15,4 @@ getgroups - getgroups32 i:ip __getgroups getgroups >> setfsgid - setfsgid32 Ei:i setfsgid >> setfsuid - setfsuid32 Ei:i setfsuid >> >> -prlimit64 EXTRA prlimit64 i:iipp prlimit64 >> 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 6ff3e8eb8a..78b2348c05 100644 >> --- a/sysdeps/unix/sysv/linux/sh/syscalls.list >> +++ b/sysdeps/unix/sysv/linux/sh/syscalls.list >> @@ -15,6 +15,4 @@ getgroups - getgroups32 i:ip __getgroups getgroups >> setfsgid - setfsgid32 Ei:i setfsgid >> setfsuid - setfsuid32 Ei:i setfsuid >> >> -prlimit64 EXTRA prlimit64 i:iipp prlimit64 >> - >> personality EXTRA personality Ei:i __personality personality >> 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 8d97a32344..3232f11f51 100644 >> --- a/sysdeps/unix/sysv/linux/wordsize-64/syscalls.list >> +++ b/sysdeps/unix/sysv/linux/wordsize-64/syscalls.list >> @@ -1,5 +1,4 @@ >> # File name Caller Syscall name # args Strong name Weak names >> >> sendfile - sendfile i:iipi sendfile sendfile64 >> -prlimit EXTRA prlimit64 i:iipp prlimit prlimit64 >> personality EXTRA personality i:i __personality personality >> -- >> 2.32.0 > > Other than the year issue (as I understand the patch is from your old branch..). > > It looks fine to me. > > -Stafford Ack.