Skip to content

Commit 266def2

Browse files
v-garojeda
authored andcommitted
rust: error: add codes from errno-base.h
Only a few codes were added so far. With the `declare_err!` macro in place, add the remaining ones (which is most of them) from `include/uapi/asm-generic/errno-base.h`. Co-developed-by: Wedson Almeida Filho <[email protected]> Signed-off-by: Wedson Almeida Filho <[email protected]> Signed-off-by: Viktor Garske <[email protected]> Reviewed-by: Gary Guo <[email protected]> [Reworded, adapted for upstream and applied latest changes] Signed-off-by: Miguel Ojeda <[email protected]>
1 parent 4b0c68b commit 266def2

File tree

1 file changed

+33
-0
lines changed

1 file changed

+33
-0
lines changed

rust/kernel/error.rs

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,40 @@ pub mod code {
1717
};
1818
}
1919

20+
declare_err!(EPERM, "Operation not permitted.");
21+
declare_err!(ENOENT, "No such file or directory.");
22+
declare_err!(ESRCH, "No such process.");
23+
declare_err!(EINTR, "Interrupted system call.");
24+
declare_err!(EIO, "I/O error.");
25+
declare_err!(ENXIO, "No such device or address.");
26+
declare_err!(E2BIG, "Argument list too long.");
27+
declare_err!(ENOEXEC, "Exec format error.");
28+
declare_err!(EBADF, "Bad file number.");
29+
declare_err!(ECHILD, "Exec format error.");
30+
declare_err!(EAGAIN, "Try again.");
2031
declare_err!(ENOMEM, "Out of memory.");
32+
declare_err!(EACCES, "Permission denied.");
33+
declare_err!(EFAULT, "Bad address.");
34+
declare_err!(ENOTBLK, "Block device required.");
35+
declare_err!(EBUSY, "Device or resource busy.");
36+
declare_err!(EEXIST, "File exists.");
37+
declare_err!(EXDEV, "Cross-device link.");
38+
declare_err!(ENODEV, "No such device.");
39+
declare_err!(ENOTDIR, "Not a directory.");
40+
declare_err!(EISDIR, "Is a directory.");
41+
declare_err!(EINVAL, "Invalid argument.");
42+
declare_err!(ENFILE, "File table overflow.");
43+
declare_err!(EMFILE, "Too many open files.");
44+
declare_err!(ENOTTY, "Not a typewriter.");
45+
declare_err!(ETXTBSY, "Text file busy.");
46+
declare_err!(EFBIG, "File too large.");
47+
declare_err!(ENOSPC, "No space left on device.");
48+
declare_err!(ESPIPE, "Illegal seek.");
49+
declare_err!(EROFS, "Read-only file system.");
50+
declare_err!(EMLINK, "Too many links.");
51+
declare_err!(EPIPE, "Broken pipe.");
52+
declare_err!(EDOM, "Math argument out of domain of func.");
53+
declare_err!(ERANGE, "Math result not representable.");
2154
}
2255

2356
/// Generic integer kernel error.

0 commit comments

Comments
 (0)