From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp11.migadu.com ([2001:41d0:403:4789::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms9.migadu.com with LMTPS id CN8aF0LKAWXwEAEA9RJhRA:P1 (envelope-from ) for ; Wed, 13 Sep 2023 16:42:10 +0200 Received: from aspmx1.migadu.com ([2001:41d0:403:4789::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp11.migadu.com with LMTPS id CN8aF0LKAWXwEAEA9RJhRA (envelope-from ) for ; Wed, 13 Sep 2023 16:42:10 +0200 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 225B741A5A for ; Wed, 13 Sep 2023 16:42:10 +0200 (CEST) Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=uni-bremen.de header.s=2019 header.b=aPnryX0h; spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org"; dmarc=fail reason="SPF not aligned (relaxed)" header.from=uni-bremen.de (policy=none) ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1694616130; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding:resent-cc: resent-from:resent-sender:resent-message-id:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=TJ+okbntvKJGNjkNjE2cQTmBYEBtyyhqtz+Q2atnhiw=; b=Vl4BtPqrDcLG8rUfzlR9t4gI6Y08yjnaMbwJ6M8FuXnfFiT6XXp6Ja6A/b6e0YCfZECuJh zoB09F6rJxu8lHAZcf+QzNoZFLcPmCguCYrSROxAxIl3czGdbF5in0McvwtCzlA3IHVapQ wfrkS+FMbJeTmymR8HawYcfsVYpH+K38Dfc4w0+iRfH7W8nnerPbjVnZreArg0PfqahKw7 kwTI21+zE88+H0VV1AnS4q4IqP+RYA+v+DXPlClt7kmUmtzDQn1Xj//ajV1fcL7Az5tE15 noPBUERVVbu1qpO9vd7rQ7zb3V0khMMClXH8U91fv+ryoA6e1bireRROmNQUdg== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=uni-bremen.de header.s=2019 header.b=aPnryX0h; spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org"; dmarc=fail reason="SPF not aligned (relaxed)" header.from=uni-bremen.de (policy=none) ARC-Seal: i=1; s=key1; d=yhetil.org; t=1694616130; a=rsa-sha256; cv=none; b=O+SIGi0OgnR6MR1Uf2ksXG7o4w1rIPgTiqlFianZcUv7tIgjqpJUY85H4wh9c8t+xUPGWX k58ys/u/J0/rU1T+26cbUivkbn9FfSkX0l0QfXvONyxKlx1ob4gihxHlPGjTxoVYSFr/E9 uqQpmgDyzX5nqZu3QXC4fPG9taZMwWOpZ/ts9rap+6x/gF26UqlElurCfeeU2VrGzsLNXm sOxOwA+OvR9Fg4Acm9WJXRUj48nvd3NDV11Z4E7d+q++2Q4oUXIg9XNq/Eo6KMWtEGgCi+ lcpie6uzLSoePbFBFBtpchCxbNoTcSOQ0wyjhrLYpdGIs4CnYY0ByzWW6H8+5A== Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qgR3z-0005I7-Rv; Wed, 13 Sep 2023 10:41:56 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qgQsP-0008KW-At for guix-patches@gnu.org; Wed, 13 Sep 2023 10:29:57 -0400 Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qgQsO-0001IV-Un for guix-patches@gnu.org; Wed, 13 Sep 2023 10:29:57 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1qgQsU-0001Td-5K for guix-patches@gnu.org; Wed, 13 Sep 2023 10:30:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#65486] [PATCH] syscalls: Add support for musl libc Resent-From: =?UTF-8?Q?S=C3=B6ren?= Tempel Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Wed, 13 Sep 2023 14:30:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 65486 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: Ludovic =?UTF-8?Q?Court=C3=A8s?= Cc: 65486@debbugs.gnu.org Received: via spool by 65486-submit@debbugs.gnu.org id=B65486.16946153485596 (code B ref 65486); Wed, 13 Sep 2023 14:30:02 +0000 Received: (at 65486) by debbugs.gnu.org; 13 Sep 2023 14:29:08 +0000 Received: from localhost ([127.0.0.1]:35541 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qgQrS-0001Qy-1E for submit@debbugs.gnu.org; Wed, 13 Sep 2023 10:29:08 -0400 Received: from smtp.zfn.uni-bremen.de ([2001:638:708:32::21]:39206) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qgN2b-0000e0-82 for 65486@debbugs.gnu.org; Wed, 13 Sep 2023 06:24:15 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=uni-bremen.de; s=2019; t=1694600641; bh=0+IVlaJaI38lvz83BKbafWDatTnaojtiAdtrFoyp/q4=; h=Date:To:Cc:From:References:In-Reply-To; b=aPnryX0hfW/ngtsxShQhh8xoecb4KRTP3hX+7J8MFDdtUBzshveaIZeO+af4vHtTE 7LPiN77xC8nJ2Lgw+owSW4Qu4CYbYghYM0CgnAy7m+qSHZGZfzk5F+P5dYSTHDnU/x aQ0McktPcEyzX0CTsIGn1xYNzmKfM3AqBGjw7yfxa3lydP/2DDqixuuHUUmbYj57Yn qxF+yIZsSn32rxwGkqaQESWqIzYRjeoFYenKvEEs7uF75oBDU9lEWNJ1hkv7lHQE8z TIaza9NO81iwREUV66mPeu7ftISbgPQIurHKZ4l5MWH0/51vpKPW57CrWmhaSqbzrx YIkCsbL9EgzUA== Received: from localhost (dynamic-002-247-249-202.2.247.pool.telefonica.de [2.247.249.202]) (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 smtp.zfn.uni-bremen.de (Postfix) with ESMTPSA id 4RlxPr6gg7zDCgV; Wed, 13 Sep 2023 12:24:00 +0200 (CEST) Date: Wed, 13 Sep 2023 12:23:50 +0200 From: =?UTF-8?Q?S=C3=B6ren?= Tempel References: <20230824063303.7928-3-soeren@soeren-tempel.net> <20230909130548.31083-2-soeren@soeren-tempel.net> <87fs3kquwl.fsf_-_@gnu.org> In-Reply-To: <87fs3kquwl.fsf_-_@gnu.org> Message-Id: <3DOVAMAK0VD13.2XDJ9MT35902D@8pit.net> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Mailman-Approved-At: Wed, 13 Sep 2023 10:28:47 -0400 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-Mailman-Approved-At: Wed, 13 Sep 2023 10:41:40 -0400 X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+larch=yhetil.org@gnu.org Sender: guix-patches-bounces+larch=yhetil.org@gnu.org X-Migadu-Flow: FLOW_IN X-Migadu-Country: US X-Migadu-Scanner: mx1.migadu.com X-Migadu-Spam-Score: -0.31 X-Spam-Score: -0.31 X-Migadu-Queue-Id: 225B741A5A X-TUID: 0I3q5QtP4BJs Hi Ludovic, Ludovic Court=C3=A8s wrote: > I think this is misleading because this has to do with the C library, > not with the kernel (=E2=80=9Clinux variant=E2=80=9D). >=20 > For example, GNU/Hurd uses the same C library as GNU/Linux, and both > should use =E2=80=9Cstatfs64=E2=80=9D, =E2=80=9Creaddir64=E2=80=9D, etc. Oh, right! I totally forgot about GNU/Hurd, thanks for pointing that out. > So what we want to check is whether we=E2=80=99re using the GNU libc or M= usl, > regardless of the kernel. Keep in mind that=E2=80=94contrary to glibc=E2=80=94musl only supports Linu= x and not GNU/Hurd. Therefore, it should be sufficient to simply check for a linux-musl host and then use statfs/readdir over statfs64/readdir64: (let ((proc (syscall->procedure (if linux-musl? "readdir" "readdir64")))) ........ Would that be acceptable? > Now, instead of checking the libc=E2=80=99s identity, we could check whet= her > =E2=80=9Cstatfs64=E2=80=9D is available, and if not, fall back to =E2=80=9C= statfs=E2=80=9D. You mean using a GNU ./configure check? That would be possible. However, I think we also need to check somehow that readdir/statfs return values are struct-layout compatible with the readdir64/statfs64 versions used by glibc. Unfortunately, I am not deeply familiar with GNU autotools. Is there a similar feature-check in the Guile code base already that I could use as a source of inspiration? Maybe the if expression outlined above would be sufficient for now and we can improve upon that later? Greetings, S=C3=B6ren