Received: by 2002:a05:7412:da14:b0:e2:908c:2ebd with SMTP id fe20csp985463rdb; Sat, 7 Oct 2023 07:08:00 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHUCqAROm2jvsfn0kL2PQSu3rA8DZlcsnze4tKEKu8oCGGNkHdgqkany7EZoYxsf+0A9AhS X-Received: by 2002:a17:902:e852:b0:1b8:af7f:6331 with SMTP id t18-20020a170902e85200b001b8af7f6331mr12331709plg.55.1696687680149; Sat, 07 Oct 2023 07:08:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696687680; cv=none; d=google.com; s=arc-20160816; b=UM4MvojfjneztGCEVJB7h5I0bqXTzmvQzQOk1/3vS7r4YshGMt6zfmLPSAVoxruni2 cuCB7iC4AWlqC2Yse9oBFO7xy2iqhiKrpxibTkMh2AvQfeRDrPi9zS5cehtJq7gFWuRl fGBYGTIAlo3pJxgQLSO12zha/bp4Cbh0IdtDjXi2crqVB6CHPNzsoi9p0ouMZ9IYxAX2 tMb2XGYNDFXewQRNbC7HvF9G4HR+qX+6oZc7PIGEKRB/sr0q7BsEdxZ9sFbmSzx87g/O kA07ZyT0VMXSXxDE0lW5ETKTCSHkk8C+1X6d1VC6fe16NGZ+jVa3Y9otnezIJYuUO2QB xIVg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:feedback-id:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from; bh=Co/sSZ+jkit0fQ8WDWt5OuQSs5Np6/bh3JBOFbEU378=; fh=YsnaDfDxYLXyjNUaE6pxZtHoKjKJwND7x6acB9InHP0=; b=06PiMafyaAUwA3+EgQsGPMYj/BnU9iWSOUo4AELig9xluLOfJDZYpAURumZOxL2m61 t9YZoi1vmAqrJAaWdWVNuGY4nV+O10N18d5dIHE/yXiEwdaVf1IFFOOGTnY6VfxvFS/L mTOenXFPfRGq5MHNp9DyCFn9UdarFBCczStuPwMOy2c/xut3Rz6xksfq4oVfZupwIpiy AHGYY9TRE5qHSWriN+09DdOKR0sAvY1m5YhAzdImyXn5SYVFlO4+WahSGLFQRCXr+JTB Rg5fT482IBq73y8eu/s8KKC2FTIV7bd8EsUhD9RpGcHszXykqeWS9NVppZv/O1GaG3bu 6sFA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from groat.vger.email (groat.vger.email. [2620:137:e000::3:5]) by mx.google.com with ESMTPS id o20-20020a170903301400b001b89bd6fd59si5678422pla.215.2023.10.07.07.07.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 07 Oct 2023 07:08:00 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) client-ip=2620:137:e000::3:5; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by groat.vger.email (Postfix) with ESMTP id D44F08098FDB; Sat, 7 Oct 2023 07:07:56 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at groat.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1343936AbjJGOHq (ORCPT + 99 others); Sat, 7 Oct 2023 10:07:46 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53576 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1343893AbjJGOHp (ORCPT ); Sat, 7 Oct 2023 10:07:45 -0400 Received: from bg4.exmail.qq.com (bg4.exmail.qq.com [43.155.65.254]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CA402BA for ; Sat, 7 Oct 2023 07:07:38 -0700 (PDT) X-QQ-mid: bizesmtp71t1696687653t72l74ws Received: from linux-lab-host.localdomain ( [116.30.131.235]) by bizesmtp.qq.com (ESMTP) with id ; Sat, 07 Oct 2023 22:07:32 +0800 (CST) X-QQ-SSF: 01200000000000E0Y000000A0000000 X-QQ-FEAT: znfcQSa1hKZKhX27X40Savq3SzwTh6BMfmcCeU6mUPa0F+q0Z0SOvYudDJUc0 DjvaJYtOnEhHzKQJZrwSAHQFhCynAM80gowZKhcc4Sc92w3lNhUylJ6g9jUcyI7cSIhrvq1 jvs0EP8xATKkKC/SYVbbv3PNBKuz6OOaOHM3X+KIRsusw/x4CViUPmCuVxSur260h1apNui s6e2ncFUvKe4BnnhEJOHVewPTDa7QIYIz29vzcbhUoCDYC/oTk6+zE1xmNX1Ubz98AWkc9d mCEE4VrV+dvsLXx43d+gOj5lhnYetZp+DRO4Ox/+brkQ91VJZ0Dq9EPwBFa8YFEozSTlblK 82pM9zSTeUeRao0q/5TonKEGC5u7pOm9TXqe1LJUN0z4KA5UesG+1A4nqm3Ew== X-QQ-GoodBg: 0 X-BIZMAIL-ID: 172060980312053188 From: Zhangjin Wu To: linux@weissschuh.net Cc: linux-kernel@vger.kernel.org, rodrigo@sdfg.com.ar, w@1wt.eu Subject: Re: [PATCH 1/1] tools/nolibc: Add workarounds for centos-7 Date: Sat, 7 Oct 2023 22:07:27 +0800 Message-Id: <20231007140727.7399-1-falcon@tinylab.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <5d4d14f5-b90d-4fd7-865e-0d64b8520c0e@t-8ch.de> References: <5d4d14f5-b90d-4fd7-865e-0d64b8520c0e@t-8ch.de> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-QQ-SENDSIZE: 520 Feedback-ID: bizesmtp:tinylab.org:qybglogicsvrgz:qybglogicsvrgz5a-1 X-Spam-Status: No, score=2.8 required=5.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RCVD_IN_SBL_CSS,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.6 X-Spam-Level: ** X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on groat.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (groat.vger.email [0.0.0.0]); Sat, 07 Oct 2023 07:07:57 -0700 (PDT) Hi, Thomas > On 2023-09-27 15:06:03+0200, Rodrigo Campos wrote: > ... > > For now we are work-arounding it by doing basically the same thing I'm doing > > here: > > https://github.com/opencontainers/runc/blob/96a61d3bf0dcc26343bfafe5112934d73d280dd3/libcontainer/dmz/xstat.h > > > > We then include this file before nolibc.h, and then the type works as fine: > > https://github.com/opencontainers/runc/blob/96a61d3bf0dcc26343bfafe5112934d73d280dd3/libcontainer/dmz/_dmz.c > > > > Would it be acceptable for nolibc if I just define what we use: > > * struct statx > > * struct statx_timestamp (used inside struct statx) > > * STATX_BASIC_STATS (or STATX_* constants too, as you prefer) > > Without __NR_statx this would still only result in dead code. > > *IF* we want to fix/work around this in nolibc it would be more like > > #ifdef __NR_statx > > /* whatever was done before */ > > #else > > int stat(const char *path, struct stat *buf) > { > return __sysret(-ENOSYS); > } > > #endif > > Or we drop the #else completely to make it obvious for applications that > stat() will just not work. This may worth a patch, sorry for my fault ;-( And to avoid breaking the older kernel users or especially for some older kernel books readers, and since this also has introduced some inconvenience to Willy, perhaps it is valuable to restore original 'sys_stat' support, I will look into how or simply revert the commit but need to add a new one for powerpc, I will learn how to avoid defining the extra structure for the not required architectures, the __ARCH_WANT_SYS_STAT macro may help. I'm also working on cleaning up the old_select(), old_mmap() and sys_fork()/sys_clone() selection support, they may be put in a series. Willy, what about your suggestion? Thanks, Zhangjin Wu