Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp4798435rwd; Sun, 4 Jun 2023 13:10:26 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5cm1OYBi2xohXEl0MUr0kl+fTEQCmwwWZX/RWYgacCElxVQRTKdXRdlKdWT0Ibfm9sJl2l X-Received: by 2002:a92:d246:0:b0:33d:5c7a:25b7 with SMTP id v6-20020a92d246000000b0033d5c7a25b7mr7626726ilg.0.1685909426023; Sun, 04 Jun 2023 13:10:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1685909425; cv=none; d=google.com; s=arc-20160816; b=zLfAPouC1mIhI69HNp96M5D1+wnzOTI7f9Dz1tPlAnPELfkb6u3CoN47fhFGbQrkdZ t4hOSWNUqERvOgzlrCsXgYDZjfZd/Yhylcfdjsy9czJb+NcbGF5L2uuCekVT+IXd4fzl xXHfIZlX8S0EyoNnVS8ppPAS/fNCBN1hhfH5COUiIhBRyXSWnHshXD6wrULSEmR7JJkH BtHDgYdtVr4RbMubzxHowqob+euhGbPbiV5BlCz+624g90HBCggDMBzT3Dn6KEUNoj26 Bzn82eDGTd73xqfj5QBC1jcXB0GkT7helW8SDCN0xG2cV3AP24M9/NzzFdIu+tYq1rw7 0SoQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:message-id:content-transfer-encoding :mime-version:subject:date:dkim-signature:from; bh=4huaC9VXtHieT6XadmlksgMDSj2EYnVaevYiX/7ICLc=; b=OsWadIECGISlX2mxoW7I7hfkV2jEQxVnmcjWyElRcCQl0NjdZdcb2tHucNxL91P5If LUpsBvcQAbfKUI7M1iNpAt3XguoZXeOswXhw+N2vK42HC3atL1nQbSe4xbDRX5OWuYCy 69S7C8JfPxvscjFmzEQ7+wL+X4/wJIlSixZKeaWWkOqitOB5D3ePLwHEedgbPaRAjfgb V9I96YHoEoKuCll7pxkM3RUR4W2R55kowBPNxloqTu/LwmNc1EM/OU5bJU5ddyg3/aZV UXc742chjeXumAQC61ATJJdvt1Ai+wrVN5O9aT4K6q7JYjER8dXFmFFn0+LCXEsMUfqS JERg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@weissschuh.net header.s=mail header.b=fZfhqK7U; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id j29-20020a633c1d000000b00530b3b5ec08si3632840pga.886.2023.06.04.13.10.11; Sun, 04 Jun 2023 13:10:25 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@weissschuh.net header.s=mail header.b=fZfhqK7U; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231769AbjFDTxF (ORCPT + 99 others); Sun, 4 Jun 2023 15:53:05 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51278 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229670AbjFDTxE (ORCPT ); Sun, 4 Jun 2023 15:53:04 -0400 Received: from todd.t-8ch.de (todd.t-8ch.de [159.69.126.157]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BB6E8AD for ; Sun, 4 Jun 2023 12:53:03 -0700 (PDT) From: =?utf-8?q?Thomas_Wei=C3=9Fschuh?= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=weissschuh.net; s=mail; t=1685908381; bh=14k5IRSBsPcfhTrwNmGrvyqKxqPkVFc5q1QH6Bsjw10=; h=From:Date:Subject:To:Cc:From; b=fZfhqK7UpBi8ijxv3lzz8TWIGemA2KdaHjvgORIK72XQSzJGyxhspbAxJlgjz58E2 EZDK2dGaVn/T6yPOJSiO67rddgdd3RDLszSXQVqq104Kvkkh49zG5DvQEp63gb9xlg 4O+Brqgt5HA9m1NzchT8UFk+FckvHJ4T1apujDOA= Date: Sun, 04 Jun 2023 21:52:59 +0200 Subject: [PATCH] tools/nolibc: handle large return values from syscall() MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit Message-Id: <20230604-nolibc-syscall-ret-v1-1-779513fc915d@weissschuh.net> X-B4-Tracking: v=1; b=H4sIAJvrfGQC/x2NQQrCQAwAv1JyNhBXLehXxMPuNmsDIZWNilL6d 4PHGRhmBecu7HAZVuj8FpfFAva7Aeqc7c4oUzAkSgca6Yi2qJSK/vWaVbHzE0+JpsbnVsZCEGH Jzlh6tjpHai/VkI/OTT7/0/W2bT+acNCFeQAAAA== To: Willy Tarreau Cc: linux-kernel@vger.kernel.org, =?utf-8?q?Thomas_Wei=C3=9Fschuh?= X-Mailer: b4 0.12.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1685908381; l=1406; i=linux@weissschuh.net; s=20221212; h=from:subject:message-id; bh=14k5IRSBsPcfhTrwNmGrvyqKxqPkVFc5q1QH6Bsjw10=; b=6H9srcXbxHIkhPOAPzotuV59uRdIyh/bbhrfg/2N20U9Tbi9zwEeQK2XTEENEqXIA/DFQGSD9 PEWqzwvqBoTCr+ZbPmt9+lMgxCVova8MJGblb8BiwN79VJa6LSRj/ty X-Developer-Key: i=linux@weissschuh.net; a=ed25519; pk=KcycQgFPX2wGR5azS7RhpBqedglOZVgRPfdFSPB1LNw= X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Syscalls return values long values. Don't truncate to int. Fixes: 33158bb86d46 ("tools/nolibc/unistd: add syscall()") Signed-off-by: Thomas Weißschuh --- Just noticed this when responding at https://lore.kernel.org/lkml/ea4e7442-7223-4211-ba29-70821e907888@t-8ch.de/ Feel free to squash this directly into the broken commit. --- tools/include/nolibc/unistd.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/include/nolibc/unistd.h b/tools/include/nolibc/unistd.h index 6773e83c16a0..c20b2fbf065e 100644 --- a/tools/include/nolibc/unistd.h +++ b/tools/include/nolibc/unistd.h @@ -58,7 +58,7 @@ int tcsetpgrp(int fd, pid_t pid) #define _syscall(N, ...) \ ({ \ - int _ret = my_syscall##N(__VA_ARGS__); \ + long _ret = my_syscall##N(__VA_ARGS__); \ if (_ret < 0) { \ SET_ERRNO(-_ret); \ _ret = -1; \ --- base-commit: a76324560e0f8f916d89452dd6aec1104e97a3c6 change-id: 20230604-nolibc-syscall-ret-520dfe9fb6b0 Best regards, -- Thomas Weißschuh