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: AS17314 8.43.84.0/22 X-Spam-Status: No, score=-4.3 required=3.0 tests=AWL,BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI,SPF_HELO_PASS,SPF_PASS shortcircuit=no autolearn=ham autolearn_force=no version=3.4.2 Received: from sourceware.org (server2.sourceware.org [8.43.85.97]) (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 76E001F4DA for ; Wed, 19 Oct 2022 22:15:38 +0000 (UTC) Authentication-Results: dcvr.yhbt.net; dkim=pass (1024-bit key; secure) header.d=sourceware.org header.i=@sourceware.org header.b="WB1o6aZi"; dkim-atps=neutral Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id A8B303856261 for ; Wed, 19 Oct 2022 22:15:37 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org A8B303856261 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1666217737; 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=WB1o6aZiQo00Y4fcbuh2RqmEugqy53ijDfzJy2OW4YiG/nbxWmlGMaSi09819D2Yr IMr+6PfzTVzWlFJ3yN/UwTMqWJLbms8jvenYguMb7UfPfIL8b5XCcgNM9S4Fyod5Oc F2xPSVcWsPHzrm3W1YR6BSRhXhRMe0GXoBsMNa6A= 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 ; 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 ; 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 (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-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 Errors-To: libc-alpha-bounces+e=80x24.org@sourceware.org Sender: "Libc-alpha" 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%) 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) -- 2.34.1