From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp11.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 yLYxCcDDy2R3aAAASxT56A (envelope-from ) for ; Thu, 03 Aug 2023 17:12:00 +0200 Received: from aspmx1.migadu.com ([2001:41d0:403:478a::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp11.migadu.com with LMTPS id cFonCcDDy2SmbwEA9RJhRA (envelope-from ) for ; Thu, 03 Aug 2023 17:12:00 +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 B67D54BD82 for ; Thu, 3 Aug 2023 17:11:59 +0200 (CEST) Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=soeren-tempel.net header.s=opensmtpd header.b=l9btCTpL; 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=soeren-tempel.net (policy=none) ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1691075520; h=from:from:sender:sender: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:resent-cc: resent-from:resent-sender:resent-message-id:list-id:list-help: list-unsubscribe:list-subscribe:list-post:dkim-signature; bh=r3t3gVofF7rn6jFPtbK1QmbTgT9C8x2E3c7+zh9ynsI=; b=a00bOgv6NnHcJDkXSJwudY+wGBbozsXCOrp+XxXsMKIdChnUtCN6RV4TF0EQJ7rU6OA6Kj uPiBhb26VKGtH/ph/isUa07394HcD6sB5IPBQEMf6VOhJTjSUYUJvGUXwssdfctPwzjt+n zL5BC6g0NB7pLAqUvKOrGJMy7YYxy3BZTM6JgyQQiq9daK54e2IRXENcAs+L/qk6xs8HFR pdkKHiskBone1DlnTqeKx44rZgxxZI6yAcFwa1CQGThbRGkHt9zpBnwiXXHz9UOG8vG7eK WB/vhbY753HghgiDRqpP/83vRZleyCzMZiRBkCPv/u1njAIX/R3ijn9mgqlhfQ== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1691075520; a=rsa-sha256; cv=none; b=WyO63DKMgC3dCb+yaH0vMN1pWage1NxFiOToIbY208vt4xhbNHDXM/YNcEt0hkGzd3TgJI d1tJDcAI1LFJWh6d+YUXJKZdJKgS41ZzMJZPAaJcZuV+UXKDd+P4EUKapbX5aPmkKP7sAT sj6ZOmujilr2NFBCxrzco2UqDrmr2aahXkr28a6Bf98PK5KJJjoXbucTIOFGHf3SbbxtTS siOQPXFTyOVZIYWDeJgVVPIdtuCpZssCeCVrHgQLv+hePKXznUdJIBX+aKVO850vcwiBtI ppwbfSEcYrA4v8kbEZs2vNv/IzJjS4LDnnYH+mmx+gP0b4dn0EH3tmRmQt069Q== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=soeren-tempel.net header.s=opensmtpd header.b=l9btCTpL; 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=soeren-tempel.net (policy=none) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qRZyE-0003Qs-Fz; Thu, 03 Aug 2023 11:10:34 -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 1qRWP9-0000wm-6b for guix-patches@gnu.org; Thu, 03 Aug 2023 07:22:07 -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 1qRWP4-0006Jc-GU for guix-patches@gnu.org; Thu, 03 Aug 2023 07:22:03 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1qRWP4-0007Mf-0k for guix-patches@gnu.org; Thu, 03 Aug 2023 07:22:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#65036] [PATCH] syscalls: Consistently use existing linux? definition Resent-From: soeren@soeren-tempel.net Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Thu, 03 Aug 2023 11:22:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 65036 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 65036@debbugs.gnu.org X-Debbugs-Original-To: guix-patches@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.169106170928283 (code B ref -1); Thu, 03 Aug 2023 11:22:01 +0000 Received: (at submit) by debbugs.gnu.org; 3 Aug 2023 11:21:49 +0000 Received: from localhost ([127.0.0.1]:50956 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qRWOr-0007M7-2f for submit@debbugs.gnu.org; Thu, 03 Aug 2023 07:21:49 -0400 Received: from lists.gnu.org ([2001:470:142::17]:37898) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qRWOo-0007Lq-6T for submit@debbugs.gnu.org; Thu, 03 Aug 2023 07:21:47 -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 1qRWOi-0000vL-6U for guix-patches@gnu.org; Thu, 03 Aug 2023 07:21:40 -0400 Received: from magnesium.8pit.net ([45.76.88.171]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qRWOe-0006GF-2I; Thu, 03 Aug 2023 07:21:39 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; s=opensmtpd; bh=piq3HuAmYz 0ZSublWNYw+q7hZm+yVf96UF/kswA9A+k=; h=date:subject:to:from; d=soeren-tempel.net; b=l9btCTpLxNOgBzx2WY4svglm/BKv0oXPirfmogQhs1Wpvmu 5fM4UtjB1wtcf35Hvy+sAArjDRKQ6WpUSl3L4mja3UkNAgkEHj8exxlXGjjArzfbZk9cEy 7c9pa9TBpvWESLyB6jAyYr03UxvfF2B1o+HqKVagSEcGt6Kz90r3Eg= Received: from localhost ( [2a02:8109:3b40:398a:3ccd:55c4:c2a:92dc]) by magnesium.8pit.net (OpenSMTPD) with ESMTPSA id 9678ec02 (TLSv1.3:TLS_AES_256_GCM_SHA384:256:YES); Thu, 3 Aug 2023 13:21:31 +0200 (CEST) From: soeren@soeren-tempel.net Date: Thu, 3 Aug 2023 13:20:09 +0200 Message-ID: <20230803112123.6866-1-soeren@soeren-tempel.net> X-Mailer: git-send-email 2.41.0 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Received-SPF: pass client-ip=45.76.88.171; envelope-from=soeren@soeren-tempel.net; helo=magnesium.8pit.net X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-Mailman-Approved-At: Thu, 03 Aug 2023 11:10:32 -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-Queue-Id: B67D54BD82 X-Migadu-Scanner: mx0.migadu.com X-Migadu-Spam-Score: -4.04 X-Spam-Score: -4.04 X-TUID: MeB0Ra5wyFvf From: Sören Tempel Instead of duplicating this existing logic across the source file. This will make it easier to add additional linux targets (e.g. linux-musl) in the future. * guix/build/syscalls.scm (readdir*): Use linux? constant. * guix/build/syscalls.scm (write-socket-address!): Use linux? constant. * guix/build/syscalls.scm (read-socket-address): Use linux? constant. Signed-off-by: Sören Tempel --- guix/build/syscalls.scm | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/guix/build/syscalls.scm b/guix/build/syscalls.scm index d947b010d3..c9c0bf594d 100644 --- a/guix/build/syscalls.scm +++ b/guix/build/syscalls.scm @@ -1244,7 +1244,7 @@ (define (readdir-procedure name-field-offset sizeof-dirent-header (define readdir* ;; Decide at run time which one must be used. - (if (string-contains %host-type "linux-gnu") + (if linux? (readdir-procedure (c-struct-field-offset %struct-dirent-header/linux name) sizeof-dirent-header/linux @@ -1664,7 +1664,7 @@ (define (write-socket-address!/hurd sockaddr bv index) (error "unsupported socket address" sockaddr))))) (define write-socket-address! - (if (string-contains %host-type "linux-gnu") + (if linux? write-socket-address!/linux write-socket-address!/hurd)) @@ -1696,7 +1696,7 @@ (define* (read-socket-address/hurd bv #:optional (index 0)) (vector family))))) (define read-socket-address - (if (string-contains %host-type "linux-gnu") + (if linux? read-socket-address/linux read-socket-address/hurd))