Received: by 2002:a05:6358:9144:b0:117:f937:c515 with SMTP id r4csp503968rwr; Wed, 3 May 2023 01:46:40 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5EHDY7W/+MJ/FoRMGVakWgfKxbLa5cn07KUpB5YkA/XUN6X7bmlnRITafvLezr1McgEm3G X-Received: by 2002:a17:903:41c4:b0:1a6:f755:a4bb with SMTP id u4-20020a17090341c400b001a6f755a4bbmr1757941ple.0.1683103599711; Wed, 03 May 2023 01:46:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1683103599; cv=none; d=google.com; s=arc-20160816; b=p9oJVm9Ac7AVNU+qm4o3TDE0jaJnkUBcZxmblPfpRBK3x5UFyE9SUqmZFOwMTb2J2w kIUBbBPL3R2GSc4TWkHrUBIIkCytXxGn0NEHJr1oboD4jEDWdH+WOBuSfmRDGl7XpIkC bat9iSZlherPjcf8AOiSLj3dzP/NsAXz+9rV12AKUrad12CDYDPW5eCa+cSglpeTwlqo kx7KcCisBFiuBjYqxEhhofSn+8Pl48ZbDKckHc8ZHPb+auGsM6jUaYyCf8WudjRB74sp weB7FSO4847qUV767VRjsmji4EVGOd2VOIs3guI5yd4wacyIPIz2V2Y6jWiNAKa5mTap TRag== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:from:subject:message-id:mime-version:date :dkim-signature; bh=tsKroyIYfOmkggcrqdey4GLuHL/j3Hn3ECNrtbDv+4k=; b=k29eaYHyieGggyBgH2tvggkgcANidoJhgB+4V1YT+K0iNK1hoaH1sNhcgjOtKKwWtS cbfJxHT30Hd/G/3dfCC9qV4FnprS2j2YE9PiDcngltJ4SRjfl04YToZ3hM0J0YramQoK glGqDdWY1pc767slM+wmNeWUUgung/alksQVws1oc4WUyi7AOqdob/qjGO6K0O5VjFth cnDNR1e440qdp6xjelJ48xvifvZqtA1FLW90NkIkyildGVhsR0QfzXCrv4IwR/sy2L7i hk2T+gpA1KzK6bworzAFQO1Ov8ybszxqKKBjc3HzGnA3HJKRReSSeZXvjFfp5URcRi8F FYPQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20221208 header.b=FreTAQEn; 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; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id s19-20020a170902b19300b001a6458c9f96si8965837plr.37.2023.05.03.01.46.22; Wed, 03 May 2023 01:46:39 -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=@google.com header.s=20221208 header.b=FreTAQEn; 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; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229964AbjECIlX (ORCPT + 99 others); Wed, 3 May 2023 04:41:23 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56816 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229768AbjECIk6 (ORCPT ); Wed, 3 May 2023 04:40:58 -0400 Received: from mail-yw1-x114a.google.com (mail-yw1-x114a.google.com [IPv6:2607:f8b0:4864:20::114a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3F25F5B90 for ; Wed, 3 May 2023 01:40:13 -0700 (PDT) Received: by mail-yw1-x114a.google.com with SMTP id 00721157ae682-55a40d32a6bso37093647b3.2 for ; Wed, 03 May 2023 01:40:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20221208; t=1683103211; x=1685695211; h=cc:to:from:subject:message-id:mime-version:date:from:to:cc:subject :date:message-id:reply-to; bh=tsKroyIYfOmkggcrqdey4GLuHL/j3Hn3ECNrtbDv+4k=; b=FreTAQEnryHPqC1s5NFCr/rg08FAyWJ++blo3gR3srCPJIWQb0UIrS35Mj4JRYVGcS yIxKzaQKAhNrc+MMIfhu3gstweG2OA1eeSUeZxLxKzOv16T4OIbdG/z6itte0rbfQRh8 iYLOyxDeydvghUIxpKHvzmrd+AD4Q1xBwRXXufmBiYEJ7wOrx4XgyMVZoCFVBcAx549y f0DLrC0U7aAKTvkgLLQWIes+zJFBQQwvu9HHDPgeUtSx1De2In1XceQPUD/Ifn31ru2u G8b8gnRqi7lGLyxzpLtqHQ5vVc6vMTgyJEInukz4V5UJCLR95ke/OkUNSMldz95iDcK4 14yQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1683103211; x=1685695211; h=cc:to:from:subject:message-id:mime-version:date:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=tsKroyIYfOmkggcrqdey4GLuHL/j3Hn3ECNrtbDv+4k=; b=Sx/uUg++Dkx23Ek7fx3a4hvji+5S56tz/AzNIMxUxR4MiSKWbdvF7hKRP9n6OYKDVL 5QGEOvh0M22NT95s44guxnq6gdl96PWguSswxT7fexZEXlxmNaIqzs0Qu8d7kL7iyNQF 89GCac+B3YX9qVptWOQllAGBvihrVAwDLZi4NHwUo7HWVZ1PnBdej51AFwUZbvDkaXiS w0FSAezHGED1uCgvEqP4J1KBtyd1SsWw023B0+n/BQtkyyBCp4tFrWc3I/wW9TEh/XuL wHjKLL9e1nolG17B9fhdKqwLWYSyhizQHcaDgpy4DUldZ4XbhOxImTqw1y0ksAVQVetQ L4fA== X-Gm-Message-State: AC+VfDxT3CKO5fdFsoaAPjRim/6drJiP8yfrVYusJ6Mal0WCaskbKrIe R5lUgePQ4VSOGtorVjhU1yKCp9iFsCP2UKI= X-Received: from aliceryhl.c.googlers.com ([fda3:e722:ac3:cc00:31:98fb:c0a8:6c8]) (user=aliceryhl job=sendgmr) by 2002:a81:e901:0:b0:54f:b986:9c60 with SMTP id d1-20020a81e901000000b0054fb9869c60mr12213286ywm.7.1683103211316; Wed, 03 May 2023 01:40:11 -0700 (PDT) Date: Wed, 3 May 2023 08:39:41 +0000 Mime-Version: 1.0 X-Mailer: git-send-email 2.40.1.495.gc816e09b53d-goog Message-ID: <20230503083941.499090-1-aliceryhl@google.com> Subject: [PATCH v1] rust: error: add ERESTARTSYS error code From: Alice Ryhl To: Miguel Ojeda , Wedson Almeida Filho , Alex Gaynor Cc: Boqun Feng , Gary Guo , "=?UTF-8?q?Bj=C3=B6rn=20Roy=20Baron?=" , Benno Lossin , Alice Ryhl , rust-for-linux@vger.kernel.org, linux-kernel@vger.kernel.org, patches@lists.linux.dev Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-9.6 required=5.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED, USER_IN_DEF_DKIM_WL 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 This error code was probably excluded here originally because it never actually reaches user programs when a syscall returns it. However, from the perspective of a kernel driver, it is still a perfectly valid error type, that the driver might need to return. E.g., this can be necessary when a signal occurs during sleep. Signed-off-by: Alice Ryhl --- rust/kernel/error.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/rust/kernel/error.rs b/rust/kernel/error.rs index 5f4114b30b94..cbde1b2d29f4 100644 --- a/rust/kernel/error.rs +++ b/rust/kernel/error.rs @@ -58,6 +58,7 @@ pub mod code { declare_err!(EPIPE, "Broken pipe."); declare_err!(EDOM, "Math argument out of domain of func."); declare_err!(ERANGE, "Math result not representable."); + declare_err!(ERESTARTSYS, "Restart the system call."); } /// Generic integer kernel error. base-commit: ea76e08f4d901a450619831a255e9e0a4c0ed162 -- 2.40.1.495.gc816e09b53d-goog