Message ID | 20221019221433.1082017-10-adhemerval.zanella@linaro.org |
---|---|
State | Committed |
Commit | f178e5173f737c33f421a7a994a3ab67a8a4eb86 |
Headers |
Return-Path: <libc-alpha-bounces+patchwork=sourceware.org@sourceware.org> 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 F19B33857415 for <patchwork@sourceware.org>; Wed, 19 Oct 2022 22:15:39 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org F19B33857415 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1666217740; bh=ATzIUyCX+xkMyp+1xRx6pUdXFhvAavBYnMLmLS4NlL4=; 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=P3CwQ3nmQWZSEoZXskcBk5YdlfLe92hz8IIBE6TspTKCFmbHHodcMz609ElhSmbu0 JUjsCapoUUTrZ6riZmRdI7DjUfsyAHRegjf9UUCeDX2f4X0I71vef/E+hYiJIo8Ulm HX6LHaNnHCGGVEW+35a0weaZEii50tYYY7Zy3wPI= X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from mail-oa1-x34.google.com (mail-oa1-x34.google.com [IPv6:2001:4860:4864:20::34]) by sourceware.org (Postfix) with ESMTPS id DD05A3857C77 for <libc-alpha@sourceware.org>; Wed, 19 Oct 2022 22:14:50 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org DD05A3857C77 Received: by mail-oa1-x34.google.com with SMTP id 586e51a60fabf-1321a1e94b3so22422240fac.1 for <libc-alpha@sourceware.org>; Wed, 19 Oct 2022 15:14:50 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=ATzIUyCX+xkMyp+1xRx6pUdXFhvAavBYnMLmLS4NlL4=; b=CF4Eqm1hJtfBuzPaUPMEr3Co7G1LxaHMA5ZIxZXkTRhPMIW1e06B3bfiSMd941QJGZ 7Ir+Oq8mxkkNQtEm3qn0MacrJFG3voxOGJ5TSftnsnuJMJtfPZyyS5ODw4lqMVb9Pt6k x7BUQ5OX1ahQhjVpZwTtvDArNGo8EbZe+PMmKtyYZ/1xpOtYKw940XC/UXFMFSj6rr5W ccdQrkDBiBMmFE8x87IzoLg6c80CkA7XFM7gRpwsi1uaaVMte7vS/WxdDOEzfXfP4kvp Jzo8GJ3uMSSg97Km7r9cmc1amm99SHz4gleWilJCbmzZ15EPl4vIQ25w/XO21XwHvaK8 Guzw== X-Gm-Message-State: ACrzQf2uSkLtgbWXRjuBJgItzVyU038dQWDQ77v5dZHekgYdqqOq46CI xKLqVs2OT5yhKpEqBYDCmtl3g8TB0wh+6Lko X-Google-Smtp-Source: AMsMyM5bZiw5SZkGkEWTDqX0ZJFj7/tRH9DthOu/jewj+ZOwTU/KqA+9O/xdZpwWy96Il4FQQgyD3w== X-Received: by 2002:a05:6871:b28:b0:132:a186:f3ff with SMTP id fq40-20020a0568710b2800b00132a186f3ffmr6159969oab.240.1666217689944; Wed, 19 Oct 2022 15:14:49 -0700 (PDT) Received: from mandiga.. ([2804:1b3:a7c3:7d19:f1c1:9fb4:472a:ab68]) by smtp.gmail.com with ESMTPSA id m9-20020aca5809000000b00353fe4fb4casm7137927oib.48.2022.10.19.15.14.48 for <libc-alpha@sourceware.org> (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 19 Oct 2022 15:14:49 -0700 (PDT) To: libc-alpha@sourceware.org Subject: [PATCH 09/30] Linux: consolidate link implementation Date: Wed, 19 Oct 2022 19:14:12 -0300 Message-Id: <20221019221433.1082017-10-adhemerval.zanella@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20221019221433.1082017-1-adhemerval.zanella@linaro.org> References: <20221019221433.1082017-1-adhemerval.zanella@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-12.7 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.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libc-alpha mailing list <libc-alpha.sourceware.org> List-Unsubscribe: <https://sourceware.org/mailman/options/libc-alpha>, <mailto:libc-alpha-request@sourceware.org?subject=unsubscribe> List-Archive: <https://sourceware.org/pipermail/libc-alpha/> List-Post: <mailto:libc-alpha@sourceware.org> List-Help: <mailto:libc-alpha-request@sourceware.org?subject=help> List-Subscribe: <https://sourceware.org/mailman/listinfo/libc-alpha>, <mailto:libc-alpha-request@sourceware.org?subject=subscribe> From: Adhemerval Zanella via Libc-alpha <libc-alpha@sourceware.org> Reply-To: Adhemerval Zanella <adhemerval.zanella@linaro.org> Errors-To: libc-alpha-bounces+patchwork=sourceware.org@sourceware.org Sender: "Libc-alpha" <libc-alpha-bounces+patchwork=sourceware.org@sourceware.org> |
Series |
Remove Linux generic sysdep
|
|
Checks
Context | Check | Description |
---|---|---|
dj/TryBot-apply_patch | success | Patch applied to master at the time it was sent |
Commit Message
Adhemerval Zanella
Oct. 19, 2022, 10:14 p.m. UTC
Use link syscall if defined, otherwise use linkat. Checked on x86_64-linux-gnu. --- sysdeps/unix/sysv/linux/{generic => }/link.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) rename sysdeps/unix/sysv/linux/{generic => }/link.c (78%)
Comments
On 10/19/22 18:14, Adhemerval Zanella via Libc-alpha wrote: > Use link syscall if defined, otherwise use linkat. > > Checked on x86_64-linux-gnu. LGTM. No regressions on x86_64 and i686. Reviewed-by: Carlos O'Donell <carlos@redhat.com> Tested-by: Carlos O'Donell <carlos@redhat.com> > --- > sysdeps/unix/sysv/linux/{generic => }/link.c | 9 +++++++-- > 1 file changed, 7 insertions(+), 2 deletions(-) > rename sysdeps/unix/sysv/linux/{generic => }/link.c (78%) > > diff --git a/sysdeps/unix/sysv/linux/generic/link.c b/sysdeps/unix/sysv/linux/link.c > similarity index 78% > rename from sysdeps/unix/sysv/linux/generic/link.c > rename to sysdeps/unix/sysv/linux/link.c > index e07655d521..eb4fe1569e 100644 > --- a/sysdeps/unix/sysv/linux/generic/link.c > +++ b/sysdeps/unix/sysv/linux/link.c > @@ -1,4 +1,5 @@ > -/* Copyright (C) 2011-2022 Free Software Foundation, Inc. > +/* Make a new name for a file. Linux version. > + Copyright (C) 2011-2022 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 > @@ -23,7 +24,11 @@ > int > __link (const char *from, const char *to) > { > - return INLINE_SYSCALL (linkat, 5, AT_FDCWD, from, AT_FDCWD, to, 0); > +#ifdef __NR_link > + return INLINE_SYSCALL_CALL (link, from, to); > +#else > + return INLINE_SYSCALL_CALL (linkat, AT_FDCWD, from, AT_FDCWD, to, 0); > +#endif OK. > } > > weak_alias (__link, link)
diff --git a/sysdeps/unix/sysv/linux/generic/link.c b/sysdeps/unix/sysv/linux/link.c similarity index 78% rename from sysdeps/unix/sysv/linux/generic/link.c rename to sysdeps/unix/sysv/linux/link.c index e07655d521..eb4fe1569e 100644 --- a/sysdeps/unix/sysv/linux/generic/link.c +++ b/sysdeps/unix/sysv/linux/link.c @@ -1,4 +1,5 @@ -/* Copyright (C) 2011-2022 Free Software Foundation, Inc. +/* Make a new name for a file. Linux version. + Copyright (C) 2011-2022 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 @@ -23,7 +24,11 @@ int __link (const char *from, const char *to) { - return INLINE_SYSCALL (linkat, 5, AT_FDCWD, from, AT_FDCWD, to, 0); +#ifdef __NR_link + return INLINE_SYSCALL_CALL (link, from, to); +#else + return INLINE_SYSCALL_CALL (linkat, AT_FDCWD, from, AT_FDCWD, to, 0); +#endif } weak_alias (__link, link)