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=-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_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 0A70F1F4DA for ; Wed, 19 Oct 2022 22:19:28 +0000 (UTC) Authentication-Results: dcvr.yhbt.net; dkim=pass (1024-bit key; secure) header.d=sourceware.org header.i=@sourceware.org header.b="uqzFSgCC"; dkim-atps=neutral Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 3F5DD383DB90 for ; Wed, 19 Oct 2022 22:19:27 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 3F5DD383DB90 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1666217967; bh=MgA4FvGy3s03NMG497LMXWeiCnUBXdu0SPdnRiTMi7M=; 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=uqzFSgCCbKm/Mn62JlOOJqLy1T5X/VHJaLux+mV/Gj+LJ2H4eZkftgOp6nIV8QN1M Gz4mbiAVUYbIsv0a6exwQeRexkTi8c3mImyV/jyEYJHH7CmahRD92rYh7XWXeuAUjL oFq92USFIEKPsGABF6SJorgregxPiGt7HaqxOtQY= Received: from mail-oa1-x29.google.com (mail-oa1-x29.google.com [IPv6:2001:4860:4864:20::29]) by sourceware.org (Postfix) with ESMTPS id 9E3773858036 for ; Wed, 19 Oct 2022 22:14:56 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 9E3773858036 Received: by mail-oa1-x29.google.com with SMTP id 586e51a60fabf-1322fa1cf6fso22394713fac.6 for ; Wed, 19 Oct 2022 15:14:56 -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=MgA4FvGy3s03NMG497LMXWeiCnUBXdu0SPdnRiTMi7M=; b=uedXGwHcsHj8RvrFiUvrKILR4gkYPBG3by31EayyydxMwuDM6io7zZonJOiYiPcfnE jzwbHV779SD9RL87Vzpq470MySbg37uPlAgQ1GFemyh640drLF+B9bdJ+dA96BX1sOIW kiyBhxPoRcQ1NOuUHDxPQftMkjls5SqWjSUEhLJp5uRargWK9PjWvMZVGJNB+orj6k0h ucysc8hlSqW0p8UtyLthUR+33c4CfQV1WaBgq+/fDr+IIDyeZUcJ1LL0LcpKhpjGu8cc U9dVOWmiZEg24wbCRSqlq4mWgewvjamnGhRoz89hmEDewx9S78GEY2Vf4ktPlLQkZ778 vEog== X-Gm-Message-State: ACrzQf2VWX5EIvIgfJ7DjtaLNXEV+7t1QEqPfY1O/4L9OR8OMjummTzC QguW6Ms6AA+qF1cCIE0t27oBEuU0/PucfJoj X-Google-Smtp-Source: AMsMyM5cP6hRSCtVhWzJJr+DA6zxTEXAXEywqFft6AHVmZVlUY8CivQyGNfonTV9bX3EgGO1COG/Dw== X-Received: by 2002:a05:6870:609c:b0:131:c972:818f with SMTP id t28-20020a056870609c00b00131c972818fmr6344249oae.2.1666217695446; Wed, 19 Oct 2022 15:14:55 -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.54 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 19 Oct 2022 15:14:55 -0700 (PDT) To: libc-alpha@sourceware.org Subject: [PATCH 13/30] Linux: consolidate symlink implementation Date: Wed, 19 Oct 2022 19:14:16 -0300 Message-Id: <20221019221433.1082017-14-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 symlink syscall if defined, otherwise use symlinkat. Checked on x86_64-linux-gnu. --- sysdeps/unix/sysv/linux/{generic => }/symlink.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) rename sysdeps/unix/sysv/linux/{generic => }/symlink.c (78%) diff --git a/sysdeps/unix/sysv/linux/generic/symlink.c b/sysdeps/unix/sysv/linux/symlink.c similarity index 78% rename from sysdeps/unix/sysv/linux/generic/symlink.c rename to sysdeps/unix/sysv/linux/symlink.c index 9242f5825e..b336d5ec4c 100644 --- a/sysdeps/unix/sysv/linux/generic/symlink.c +++ b/sysdeps/unix/sysv/linux/symlink.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,6 +24,10 @@ int __symlink (const char *from, const char *to) { - return INLINE_SYSCALL (symlinkat, 3, from, AT_FDCWD, to); +#ifdef __NR_symlink + return INLINE_SYSCALL_CALL (symlink, from, to); +#else + return INLINE_SYSCALL_CALL (symlinkat, from, AT_FDCWD, to); +#endif } weak_alias (__symlink, symlink) -- 2.34.1