From: Alice Ryhl <aliceryhl@google.com>
To: Miguel Ojeda <ojeda@kernel.org>,
Wedson Almeida Filho <wedsonaf@gmail.com>,
Alex Gaynor <alex.gaynor@gmail.com>
Cc: "Boqun Feng" <boqun.feng@gmail.com>,
"Gary Guo" <gary@garyguo.net>,
"Björn Roy Baron" <bjorn3_gh@protonmail.com>,
"Benno Lossin" <benno.lossin@proton.me>,
"Alice Ryhl" <aliceryhl@google.com>,
rust-for-linux@vger.kernel.org, linux-kernel@vger.kernel.org,
patches@lists.linux.dev
Subject: [PATCH v1] rust: error: add ERESTARTSYS error code
Date: Wed, 3 May 2023 08:39:41 +0000 [thread overview]
Message-ID: <20230503083941.499090-1-aliceryhl@google.com> (raw)
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 <aliceryhl@google.com>
---
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
next reply other threads:[~2023-05-03 8:41 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-05-03 8:39 Alice Ryhl [this message]
2023-05-03 9:50 ` [PATCH v1] rust: error: add ERESTARTSYS error code Miguel Ojeda
-- strict thread matches above, loose matches on Subject: below --
2023-04-26 22:57 [PATCH] rust: bindings: fix sorting of rust/bindings/bindings_helper.h's #includes materoy
2023-05-03 10:59 ` [PATCH v1] rust: error: add ERESTARTSYS error code Alice Ryhl
2023-05-03 11:02 ` Alice Ryhl
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20230503083941.499090-1-aliceryhl@google.com \
--to=aliceryhl@google.com \
--cc=alex.gaynor@gmail.com \
--cc=benno.lossin@proton.me \
--cc=bjorn3_gh@protonmail.com \
--cc=boqun.feng@gmail.com \
--cc=gary@garyguo.net \
--cc=linux-kernel@vger.kernel.org \
--cc=ojeda@kernel.org \
--cc=patches@lists.linux.dev \
--cc=rust-for-linux@vger.kernel.org \
--cc=wedsonaf@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).