From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp10.migadu.com ([2001:41d0:403:478a::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms9.migadu.com with LMTPS id 0N43HngeAmWlgAEAG6o9tA:P1 (envelope-from ) for ; Wed, 13 Sep 2023 22:41:28 +0200 Received: from aspmx1.migadu.com ([2001:41d0:403:478a::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp10.migadu.com with LMTPS id 0N43HngeAmWlgAEAG6o9tA (envelope-from ) for ; Wed, 13 Sep 2023 22:41:28 +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 6DB7E614D6 for ; Wed, 13 Sep 2023 22:41:28 +0200 (CEST) Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gnu.org header.s=fencepost-gnu-org header.b=m3I7bmwR; dmarc=pass (policy=none) header.from=gnu.org; 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" ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1694637688; 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=rSzoXrW8NxNmcoJtC6Oout15roBu3yiJOPi/IwVxezM=; b=nRl8DxfNkV6hDwzFcbgjKXNP9y1aDPn7DYidOG6GLeYwuvZ/Q9MfRcB8l4327Jj3Q2fRuq H2mxxTYuRlFBRwcFMkoASeWyiNw6atYxhBdnNf+Tt1p4/N0Gwljs5V3gg70a8g6boUEJPh 013q3UEhMKlkwYqnT3MvghhsruBIMv60Jz64QWkTJ/vmlzXUx8GM72Drml61B4JPW5djDG vOKEGm8KbcZWQ2XNgdGBrHSYJbcgCgLTwllFx7i39x5W7EGa5ucJyHhUqMNWfD+ePeqTfJ ygvdxM3v66HYrQkkj1ncxxKrBWK18Ezaphhiyrzixy1UzhG2QwRoomuk3wA7Xw== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1694637688; a=rsa-sha256; cv=none; b=P+fz8zfIjj02MbkueIMGj4g/0vkbdmZ3U9zgQrWjozZCCrHMqBZphTlw2BbPGvOnAsw3vX Ksrs8KvvEMON0fSCYFhKAbHqcPylt0aHd4SZxh6511WHwR2/Ef4ny/m5VZT0GxCXMiYcXV q+bPJVpq+q1N5mC2oN8IV5+NNbMffPSZT0A89b2n50baSvKVZBnFhyOgmrtr+Jd9/VBdx4 u+dckr3D0SbX8Dx5Ww0Y5yNyQJz9hNR6cT5zc2RT+TP1GCMauhcFfcTetp+RTDMET9So0v kWR4sB2h0aAHEgmh+rQu/11lu2JFvfhR+gjlv/51iyJDRxNKA+M403SdRbPbMA== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gnu.org header.s=fencepost-gnu-org header.b=m3I7bmwR; dmarc=pass (policy=none) header.from=gnu.org; 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" Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qgWfV-00062P-Nx; Wed, 13 Sep 2023 16:41:02 -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 1qgWfR-0005r9-8o for guix-patches@gnu.org; Wed, 13 Sep 2023 16:40: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 1qgWfR-0006OU-0Q for guix-patches@gnu.org; Wed, 13 Sep 2023 16:40:57 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1qgWfW-0007ig-B0 for guix-patches@gnu.org; Wed, 13 Sep 2023 16:41:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#65486] [PATCH] syscalls: Add support for musl libc Resent-From: Ludovic =?UTF-8?Q?Court=C3=A8s?= Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Wed, 13 Sep 2023 20:41: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: =?UTF-8?Q?S=C3=B6ren?= Tempel Cc: 65486@debbugs.gnu.org Received: via spool by 65486-submit@debbugs.gnu.org id=B65486.169463760829585 (code B ref 65486); Wed, 13 Sep 2023 20:41:02 +0000 Received: (at 65486) by debbugs.gnu.org; 13 Sep 2023 20:40:08 +0000 Received: from localhost ([127.0.0.1]:36188 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qgWed-0007h5-EV for submit@debbugs.gnu.org; Wed, 13 Sep 2023 16:40:07 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:51886) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qgWea-0007gU-Me for 65486@debbugs.gnu.org; Wed, 13 Sep 2023 16:40:05 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qgWeO-0005xp-2D; Wed, 13 Sep 2023 16:39:52 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:In-Reply-To:Date:References:Subject:To: From; bh=rSzoXrW8NxNmcoJtC6Oout15roBu3yiJOPi/IwVxezM=; b=m3I7bmwRB6ATp6gUPqeM W6j2MCAxhmRx1pqU5ceozVpJ/Kc4G5N+aS83A91XfJwvHblBo0LEPTuKQBwRevGVLO7jtHnuLd9oN DkC+r6gvC3cWYlAnxImNL15+brn2F7h2W+Kl9eufvVkagYee+bK/qdXvfFVe0s91cukCZZFspXtEL eDI7szDvlY+SD3HcOjI423Q6rbjw7L8MolX97MEJpqgP0dP1n1OO4XGXn4Z1iJqsu+Ygcuf97tfxu 71tpNfcK6EMaxTlNAe0/pAYbkRftkYWS4W1bdP6ZbkjbBdUv6ilOAbLW4HoBso/qBbKexa+PMMm4R RitNCqMh9v/uuA==; From: Ludovic =?UTF-8?Q?Court=C3=A8s?= References: <20230824063303.7928-3-soeren@soeren-tempel.net> <20230909130548.31083-2-soeren@soeren-tempel.net> <87fs3kquwl.fsf_-_@gnu.org> <3DOVAMAK0VD13.2XDJ9MT35902D@8pit.net> X-URL: http://www.fdn.fr/~lcourtes/ X-Revolutionary-Date: Septidi 27 Fructidor an 231 de la =?UTF-8?Q?R=C3=A9volution, ?= jour de la Verge-d'or X-PGP-Key-ID: 0x090B11993D9AEBB5 X-PGP-Key: http://www.fdn.fr/~lcourtes/ludovic.asc X-PGP-Fingerprint: 3CE4 6455 8A84 FDC6 9DB4 0CFB 090B 1199 3D9A EBB5 X-OS: x86_64-pc-linux-gnu Date: Wed, 13 Sep 2023 22:39:50 +0200 In-Reply-To: <3DOVAMAK0VD13.2XDJ9MT35902D@8pit.net> ("=?UTF-8?Q?S=C3=B6ren?= Tempel"'s message of "Wed, 13 Sep 2023 12:23:50 +0200") Message-ID: <87cyylkdt5.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list 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-Spam-Score: -3.98 X-Spam-Score: -3.98 X-Migadu-Queue-Id: 6DB7E614D6 X-Migadu-Scanner: mx0.migadu.com X-TUID: W3N0qs03RunR Hi, S=C3=B6ren Tempel skribis: > Ludovic Court=C3=A8s wrote: [...] >> So what we want to check is whether we=E2=80=99re using the GNU libc or = Musl, >> regardless of the kernel. > > Keep in mind that=E2=80=94contrary to glibc=E2=80=94musl only supports Li= nux 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? You could call it =E2=80=98musl?=E2=80=99 instead, to (hopefully) convey we= =E2=80=99re interested in the C library specifically. >> Now, instead of checking the libc=E2=80=99s identity, we could check whe= ther >> =E2=80=9Cstatfs64=E2=80=9D is available, and if not, fall back to =E2=80= =9Cstatfs=E2=80=9D. > > You mean using a GNU ./configure check? No no, I meant something like: (or (false-if-exception (dynamic-func "readdir64" (dynamic-link))) (dynamic-func "readdir" (dynamic-link))) Of course, it=E2=80=99s not as simple as this because we=E2=80=99d rather h= ave it integrated with =E2=80=98syscall->procedure=E2=80=99 (maybe by adding an #:alternative-name argument for the Musl name?), but you get the idea. HTH! Ludo=E2=80=99.