Skip to content

Commit fe5f11e

Browse files
author
Sladyn Nunes
committed
Sort errors in error.rs in order according to include/uapi/asm-generic/errno-base.h
1 parent bfe9ec6 commit fe5f11e

File tree

1 file changed

+23
-23
lines changed

1 file changed

+23
-23
lines changed

rust/kernel/error.rs

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -24,41 +24,41 @@ use core::str::{self, Utf8Error};
2424
pub struct Error(c_types::c_int);
2525

2626
impl Error {
27-
/// Invalid argument.
28-
pub const EINVAL: Self = Error(-(bindings::EINVAL as i32));
27+
/// Operation not permitted.
28+
pub const EPERM: Self = Error(-(bindings::EPERM as i32));
2929

30-
/// Out of memory.
31-
pub const ENOMEM: Self = Error(-(bindings::ENOMEM as i32));
30+
/// No such file or directory.
31+
pub const ENOENT: Self = Error(-(bindings::ENOENT as i32));
3232

33-
/// Bad address.
34-
pub const EFAULT: Self = Error(-(bindings::EFAULT as i32));
33+
/// No such process.
34+
pub const ESRCH: Self = Error(-(bindings::ESRCH as i32));
3535

36-
/// Illegal seek.
37-
pub const ESPIPE: Self = Error(-(bindings::ESPIPE as i32));
36+
/// Interrupted system call.
37+
pub const EINTR: Self = Error(-(bindings::EINTR as i32));
38+
39+
/// Bad file number.
40+
pub const EBADF: Self = Error(-(bindings::EBADF as i32));
3841

3942
/// Try again.
4043
pub const EAGAIN: Self = Error(-(bindings::EAGAIN as i32));
4144

42-
/// Device or resource busy.
43-
pub const EBUSY: Self = Error(-(bindings::EBUSY as i32));
44-
45-
/// Restart the system call.
46-
pub const ERESTARTSYS: Self = Error(-(bindings::ERESTARTSYS as i32));
45+
/// Out of memory.
46+
pub const ENOMEM: Self = Error(-(bindings::ENOMEM as i32));
4747

48-
/// Operation not permitted.
49-
pub const EPERM: Self = Error(-(bindings::EPERM as i32));
48+
/// Bad address.
49+
pub const EFAULT: Self = Error(-(bindings::EFAULT as i32));
5050

51-
/// No such process.
52-
pub const ESRCH: Self = Error(-(bindings::ESRCH as i32));
51+
/// Device or resource busy.
52+
pub const EBUSY: Self = Error(-(bindings::EBUSY as i32));
5353

54-
/// No such file or directory.
55-
pub const ENOENT: Self = Error(-(bindings::ENOENT as i32));
54+
/// Invalid argument.
55+
pub const EINVAL: Self = Error(-(bindings::EINVAL as i32));
5656

57-
/// Interrupted system call.
58-
pub const EINTR: Self = Error(-(bindings::EINTR as i32));
57+
/// Illegal seek.
58+
pub const ESPIPE: Self = Error(-(bindings::ESPIPE as i32));
5959

60-
/// Bad file number.
61-
pub const EBADF: Self = Error(-(bindings::EBADF as i32));
60+
/// Restart the system call.
61+
pub const ERESTARTSYS: Self = Error(-(bindings::ERESTARTSYS as i32));
6262

6363
/// Creates an [`Error`] from a kernel error code.
6464
///

0 commit comments

Comments
 (0)