F´ Flight Software - C/C++ Documentation
A framework for building embedded system applications to NASA flight quality standards.
Loading...
Searching...
No Matches
error.cpp
Go to the documentation of this file.
1// ======================================================================
2// \title Os/Posix/error.cpp
3// \brief implementation for posix errno conversion
4// ======================================================================
5#include <cerrno>
6#include "Os/Posix/error.hpp"
7
8namespace Os {
9namespace Posix {
10
13 switch (errno_input) {
14 case 0:
15 status = File::Status::OP_OK;
16 break;
17 // Fallthrough intended
18 case ENOSPC:
19 case EFBIG:
21 break;
22 case ENOENT:
24 break;
25 // Fallthrough intended
26 case EPERM:
27 case EACCES:
29 break;
30 case EEXIST:
32 break;
33 case EBADF:
35 break;
36 // Fallthrough intended
37 case ENOSYS:
38 case EOPNOTSUPP:
40 break;
41 case EINVAL:
43 break;
44 default:
46 break;
47 }
48 return status;
49}
50
53 switch (errno_input) {
54 case 0:
56 break;
57 // All fall through are intended to fallback on OTHER_ERROR
58 case EACCES:
60 break;
61 case EPERM:
62 case EROFS:
63 case EFAULT:
65 break;
66 case EEXIST:
68 break;
69 case ELOOP:
70 case ENOENT:
72 break;
73 case ENAMETOOLONG:
75 break;
76 case ENOTDIR:
78 break;
79 case EDQUOT:
81 break;
82 case EMLINK:
84 break;
85 case ENOSPC:
86 case EFBIG:
88 break;
89 case ENOSYS:
90 case EOPNOTSUPP:
92 break;
93 case ERANGE:
95 break;
96 case EXDEV:
98 break;
99 default:
101 break;
102 }
103 return status;
104}
105
108 switch (errno_input) {
109 case 0:
111 break;
112 case ENOENT:
114 break;
115 case EACCES:
117 break;
118 case ENOTDIR:
120 break;
121 case EEXIST:
123 break;
124 default:
126 break;
127 }
128 return status;
129}
130
133 switch (errno_input) {
134 case 0:
135 status = RawTime::Status::OP_OK;
136 break;
137 case EINVAL:
139 break;
140 default:
142 break;
143 }
144 return status;
145}
146
149 switch (posix_status) {
150 case 0:
151 status = Task::Status::OP_OK;
152 break;
153 case EINVAL:
155 break;
156 case EPERM:
158 break;
159 case EAGAIN:
161 break;
162 default:
164 break;
165 }
166 return status;
167}
168
171 switch (posix_status) {
172 case 0:
173 status = Mutex::Status::OP_OK;
174 break;
175 case EBUSY:
177 break;
178 case EDEADLK:
180 break;
181 default:
183 break;
184 }
185 return status;
186}
187}
188}
int PlatformIntType
DefaultTypes.hpp provides fallback defaults for the platform types.
@ DOESNT_EXIST
Directory doesn't exist.
Definition Directory.hpp:21
@ NO_PERMISSION
No permission to read directory.
Definition Directory.hpp:22
@ OP_OK
Operation was successful.
Definition Directory.hpp:20
@ NOT_DIR
Path is not a directory.
Definition Directory.hpp:24
@ OTHER_ERROR
A catch-all for other errors. Have to look in implementation-specific code.
Definition Directory.hpp:30
@ ALREADY_EXISTS
Directory already exists.
Definition Directory.hpp:28
@ NO_SPACE
No space left.
Definition File.hpp:32
@ NOT_SUPPORTED
Kernel or file system does not support operation.
Definition File.hpp:37
@ INVALID_ARGUMENT
Invalid argument passed in.
Definition File.hpp:39
@ NO_PERMISSION
No permission to read/write file.
Definition File.hpp:33
@ NOT_OPENED
file hasn't been opened yet
Definition File.hpp:35
@ OTHER_ERROR
A catch-all for other errors. Have to look in implementation-specific code.
Definition File.hpp:40
@ OP_OK
Operation was successful.
Definition File.hpp:30
@ DOESNT_EXIST
File doesn't exist (for read)
Definition File.hpp:31
@ FILE_EXISTS
file already exist (for CREATE with O_EXCL enabled)
Definition File.hpp:36
@ ALREADY_EXISTS
File already exists.
@ NO_PERMISSION
No permission to write.
@ OP_OK
Operation was successful.
@ NOT_DIR
Path is not a directory.
@ OTHER_ERROR
other OS-specific error
@ NOT_SUPPORTED
Operation is not supported by the current implementation.
@ BUFFER_TOO_SMALL
Buffer size is too small to hold full path (for getWorkingDirectory)
@ DOESNT_EXIST
Path doesn't exist.
@ FILE_LIMIT
Too many files or links.
@ NO_SPACE
No space left.
@ INVALID_PATH
Path is too long, too many sym links, etc.
@ OP_OK
Operation was successful.
Definition Mutex.hpp:18
@ ERROR_BUSY
Mutex is busy.
Definition Mutex.hpp:19
@ ERROR_DEADLOCK
Deadlock condition detected.
Definition Mutex.hpp:20
@ ERROR_OTHER
All other errors.
Definition Mutex.hpp:21
@ INVALID_PARAMS
Parameters invalid for current platform.
Definition RawTime.hpp:30
@ OP_OK
Operation was successful.
Definition RawTime.hpp:28
@ OTHER_ERROR
All other errors.
Definition RawTime.hpp:31
@ OP_OK
message sent/received okay
Definition Task.hpp:30
@ UNKNOWN_ERROR
unexpected error return value
Definition Task.hpp:34
@ ERROR_PERMISSION
permissions error setting-up tasks
Definition Task.hpp:39
@ INVALID_PARAMS
started task with invalid parameters
Definition Task.hpp:32
@ ERROR_RESOURCES
unable to allocate more tasks
Definition Task.hpp:38
File::Status errno_to_file_status(PlatformIntType errno_input)
Definition error.cpp:11
Directory::Status errno_to_directory_status(PlatformIntType errno_input)
Definition error.cpp:106
FileSystem::Status errno_to_filesystem_status(PlatformIntType errno_input)
Definition error.cpp:51
Task::Status posix_status_to_task_status(PlatformIntType posix_status)
Definition error.cpp:147
Mutex::Status posix_status_to_mutex_status(PlatformIntType posix_status)
Definition error.cpp:169
RawTime::Status errno_to_rawtime_status(PlatformIntType errno_input)
Definition error.cpp:131