From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by sourceware.org (Postfix) with ESMTPS id 075E23940CF5 for ; Mon, 5 Dec 2022 16:39:55 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 075E23940CF5 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1670258394; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=nrFenDM/XnZ4xBZYLDMMzVLorobSL010TX7GdIrqwXM=; b=dya3m4vsKKJZzHkR8AHjMCGKY/1hvUAHpMk8SkAjcoSbd+n9yoK57pOkfnOq80ZHyK0xOy c3F4nof4k/M1qZqTTKabLBcla1fvwtl15k5Tv4md1gp7Gqpxl5KTvmhwlIhjNduQUc/QtG 29krBOSLl2ayGbq+bz7Gk1hQhnPa4+8= Received: from mail-io1-f69.google.com (mail-io1-f69.google.com [209.85.166.69]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-190-UEglaUUUPfKul9dSbl-WKg-1; Mon, 05 Dec 2022 11:39:53 -0500 X-MC-Unique: UEglaUUUPfKul9dSbl-WKg-1 Received: by mail-io1-f69.google.com with SMTP id f3-20020a5ec703000000b006dfc19c6378so10065574iop.12 for ; Mon, 05 Dec 2022 08:39:53 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:in-reply-to:organization:from:references :to:content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=nrFenDM/XnZ4xBZYLDMMzVLorobSL010TX7GdIrqwXM=; b=nMBj8zlEg0W04vDI2db5E9ayEpPbwIWfC/6ogSuDOGK3RVGg2iFp5Yk6f/yrwTDNyx B+1InNr9shotsxze0jmqiHe3LWmnsB/ULMtlaJ5sRNovb7FTIklVnf1B37b53bDQv1L2 3mHOiDBayeKVhahrLMbKQmW911mzCsvgFW3oUCEVIBrEqIyUK5CnJ9aHgKc0Ww5MMiZM zpJIUjFXqW9ZR3tzrUAux+94KkPmKLaKBdwnWC3kITPQTc70tzGirDZYUc3v2jycd51z RcmgzJFdPa1U6QGhxiQ6/PlbYnPF9OHEsfR6NVxLt+tJ/wrda4jhLoKHtMAezqwSRgra ZeNg== X-Gm-Message-State: ANoB5plTjNv0cEVHY7C2vsC3U2Taa226/CtppfiqNyVtb2yw9wkJ8g5s 0sqXaTNDlvUf3TVkbSWQAuGBcwBRY75C3QwByru9qPRn7FKvzlGT66F1Ir8iqwfRmNCHe6gFcoN QWLapuivsSxeHT4qEuyP/ X-Received: by 2002:a05:6602:220c:b0:6df:3e12:b640 with SMTP id n12-20020a056602220c00b006df3e12b640mr21759774ion.124.1670258392532; Mon, 05 Dec 2022 08:39:52 -0800 (PST) X-Google-Smtp-Source: AA0mqf4LgvFPMjC3a+nsOPFvLeWLZlD67esxi8Tsq/YTBYLm5tZZbJLqwIhSDIzPUfYL58ZEV+Wbgg== X-Received: by 2002:a05:6602:220c:b0:6df:3e12:b640 with SMTP id n12-20020a056602220c00b006df3e12b640mr21759766ion.124.1670258392307; Mon, 05 Dec 2022 08:39:52 -0800 (PST) Received: from [192.168.0.241] (192-0-145-146.cpe.teksavvy.com. [192.0.145.146]) by smtp.gmail.com with ESMTPSA id q5-20020a920505000000b002e85e8b8d1dsm539283ile.5.2022.12.05.08.39.51 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 05 Dec 2022 08:39:51 -0800 (PST) Message-ID: <48bcd552-dc8e-97c8-4902-590346d39665@redhat.com> Date: Mon, 5 Dec 2022 11:39:50 -0500 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.4.0 Subject: Re: [PATCH 11/30] Linux: consolidate readlink implementation To: Adhemerval Zanella , libc-alpha@sourceware.org References: <20221019221433.1082017-1-adhemerval.zanella@linaro.org> <20221019221433.1082017-12-adhemerval.zanella@linaro.org> From: Carlos O'Donell Organization: Red Hat In-Reply-To: <20221019221433.1082017-12-adhemerval.zanella@linaro.org> X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Language: en-US Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-12.6 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,GIT_PATCH_0,NICE_REPLY_A,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_NONE,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 List-Id: On 10/19/22 18:14, Adhemerval Zanella via Libc-alpha wrote: > Use readlink syscall if defined, otherwise readlinkat. > > Checked on x86_64-linux-gnu. LGTM. No regressions on x86_64 and i686. Reviewed-by: Carlos O'Donell Tested-by: Carlos O'Donell > --- > sysdeps/unix/sysv/linux/{generic => }/readlink.c | 9 +++++++-- > 1 file changed, 7 insertions(+), 2 deletions(-) > rename sysdeps/unix/sysv/linux/{generic => }/readlink.c (80%) > > diff --git a/sysdeps/unix/sysv/linux/generic/readlink.c b/sysdeps/unix/sysv/linux/readlink.c > similarity index 80% > rename from sysdeps/unix/sysv/linux/generic/readlink.c > rename to sysdeps/unix/sysv/linux/readlink.c > index 9f25811a35..083dcaf502 100644 > --- a/sysdeps/unix/sysv/linux/generic/readlink.c > +++ b/sysdeps/unix/sysv/linux/readlink.c > @@ -1,4 +1,5 @@ > -/* Copyright (C) 2011-2022 Free Software Foundation, Inc. > +/* Read value of a symbolic link. 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 > @@ -25,6 +26,10 @@ > ssize_t > __readlink (const char *path, char *buf, size_t len) > { > - return INLINE_SYSCALL (readlinkat, 4, AT_FDCWD, path, buf, len); > +#ifdef __NR_readlink > + return INLINE_SYSCALL_CALL (readlink, path, buf, len); > +#else > + return INLINE_SYSCALL_CALL (readlinkat, AT_FDCWD, path, buf, len); > +#endif OK. > } > weak_alias (__readlink, readlink) -- Cheers, Carlos.