File tree Expand file tree Collapse file tree 2 files changed +27
-4
lines changed Expand file tree Collapse file tree 2 files changed +27
-4
lines changed Original file line number Diff line number Diff line change @@ -69,6 +69,32 @@ int mapFlags(OpenFlags flags)
69
69
return ret;
70
70
}
71
71
72
+ int syserr ()
73
+ {
74
+ switch (errno) {
75
+ case EPERM:
76
+ case EACCES:
77
+ return Error::Denied;
78
+ case ENOMEM:
79
+ return Error::NoMem;
80
+ case ENOENT:
81
+ return Error::NotFound;
82
+ case ENFILE:
83
+ case EMFILE:
84
+ return Error::OutOfFileDescs;
85
+ case EFBIG:
86
+ return Error::TooBig;
87
+ case ENOSPC:
88
+ return Error::NoSpace;
89
+ case EROFS:
90
+ return Error::ReadOnly;
91
+ case EINVAL:
92
+ return Error::BadParam;
93
+ default :
94
+ return Error::fromSystem (-errno);
95
+ }
96
+ }
97
+
72
98
String getErrorString (int err)
73
99
{
74
100
if (Error::isSystem (err)) {
Original file line number Diff line number Diff line change @@ -34,10 +34,7 @@ namespace IFS::Host
34
34
/* *
35
35
* @brief Get IFS error code for the current system errno
36
36
*/
37
- inline int syserr ()
38
- {
39
- return Error::fromSystem (-errno);
40
- }
37
+ int syserr ();
41
38
42
39
/* *
43
40
* @brief Get corresponding host flags for given IFS flags
You can’t perform that action at this time.
0 commit comments