Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2F6CAC05027 for ; Thu, 9 Feb 2023 02:15:09 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231737AbjBICPI (ORCPT ); Wed, 8 Feb 2023 21:15:08 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50024 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231728AbjBICPG (ORCPT ); Wed, 8 Feb 2023 21:15:06 -0500 Received: from mail-lj1-x22f.google.com (mail-lj1-x22f.google.com [IPv6:2a00:1450:4864:20::22f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2185F273C for ; Wed, 8 Feb 2023 18:15:04 -0800 (PST) Received: by mail-lj1-x22f.google.com with SMTP id h4so533513lja.2 for ; Wed, 08 Feb 2023 18:15:04 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=ZR54mJXwASvQGnAdij+ZNHiNC8eGa7TLZRG1R8sZ1FE=; b=CGN/82Z0Rf2APBROkVXBhyeM/niTSI8x1hqX4A2fudHYjjDuyT2/rKROdDEYgYmFTI Fw66UeDlGPJ1sOM+AaZtSJZuWBo3A5lcBYMDjQbQjMY6Z/1o6EUNPOYB7+asfROVfo8Z 32rGO9TlqQ03qZfuAhF9IPX0sWUwTYCnT1U03OCCsYVze0ZT2lCfN55VY2w69qManxY8 8GxP5U8z0TIZ6GFEBEyZfiVirNoKAV3u3wulYD/legsWhveNsCdF1pXutvrDIzgQ99pp 6Dc+1dglsYQpmxHcU4pigvLC7cCeK3LHq6IF3KYglPTZhdSmva3SXbd/bbmrVMmKn9FZ p0VQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=ZR54mJXwASvQGnAdij+ZNHiNC8eGa7TLZRG1R8sZ1FE=; b=h3z28y9/Og/srqqWEwj/TQ0S3a45IWv5qlMF6nD48yciTiwQF7Df6+PPSJE0vXurxg n14cFoTb7IbKOqVoZY6vw5bVE2I55yEnpFTnNtjs+6TqPS42x3RmwjqJye+shAuS3soZ pco7QZS/qBaVAc2cx9dC6dK+JFhcz6pyCDG8bD6LMWXHOx3u8OHwtJ4pjWgii15VIxAW rdWaWKlmgc9MkngpMvN8jDFhFJmUskurSKyjmAtFcvaIuU4s9ed4d9iN6UHiG+hKHRII wtpJ1o5CerlU0Twlrs9O42U4+/eRh/mCOglOBb3lmZnkBKP7lkzmqF48A+R2R0rlvRub p+aA== X-Gm-Message-State: AO0yUKVLu+SEHsVL7HaNTtsG9DpWP4O77puSqPlsj5AKZqoOBH3MiLRs 5sSAAVLnO/LqlVeSsJ+J1HlJlb4F3725RPNtpms= X-Google-Smtp-Source: AK7set+agdxY6pTTDEx797/vZ5UWomhA83EIT9xQ1l9iTwj7V4rHHdxzX0o/dedbejg+xZX2FUN6KBI/fg3c9kt1JUs= X-Received: by 2002:a2e:8e6c:0:b0:28e:bba7:22dc with SMTP id t12-20020a2e8e6c000000b0028ebba722dcmr1669351ljk.56.1675908902331; Wed, 08 Feb 2023 18:15:02 -0800 (PST) MIME-Version: 1.0 References: In-Reply-To: From: Feiyang Chen Date: Thu, 9 Feb 2023 10:14:50 +0800 Message-ID: Subject: Re: [PATCH v2 2/5] tools/nolibc: Add statx() and make stat() rely on statx() when available To: David Laight Cc: "w@1wt.eu" , "paulmck@kernel.org" , Feiyang Chen , "arnd@arndb.de" , "chenhuacai@kernel.org" , "jiaxun.yang@flygoat.com" , "loongarch@lists.linux.dev" , "linux-kernel@vger.kernel.org" Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, 9 Feb 2023 at 06:39, David Laight wrote: > > From: chris.chenfeiyang@gmail.com > > Sent: 08 February 2023 10:18 > > > > loongarch and riscv32 only have statx(). arc, hexagon, nios2 and > > openrisc have statx() and stat64() but not stat() or newstat(). > > Add statx() and make stat() rely on statx() to make them happy. > > > ... > > +#ifdef __NR_statx > > +static __attribute__((unused)) > > +int sys_stat(const char *path, struct stat *buf) > > +{ > > + struct statx stat; > > If seems wrong that 'stat' has type 'struct statx' > and 'buf' type 'struct stat *'. > > Maybe s/stat./statx./ and s/buf->/stat->/ ? > Hi, David, Yes, it looks better to use 'struct statx statx'. Thank you! I'd like to keep 'buf' to be consistent with the stat() below. int stat(const char *path, struct stat *buf); Thanks, Feiyang > David > > - > Registered Address Lakeside, Bramley Road, Mount Farm, Milton Keynes, MK1 1PT, UK > Registration No: 1397386 (Wales) >