muteki
Loading...
Searching...
No Matches
errno.h
Go to the documentation of this file.
1/*
2 * Copyright 2021-present dogtopus
3 * SPDX-License-Identifier: MIT
4 */
5
12#ifndef __MUTEKI_ERRNO_H__
13#define __MUTEKI_ERRNO_H__
14
15#include <muteki/common.h>
16
17#ifdef __cplusplus
18extern "C" {
19#endif
20
22typedef unsigned int kerrno_t;
23
34
48
116
144
261
268static inline unsigned short KERRNO_NS(kerrno_t kerrno) {
269 return kerrno >> 16;
270}
271
279static inline unsigned short KERRNO_ERR(kerrno_t kerrno) {
280 return kerrno & 0xffff;
281}
282
300extern size_t FormatMessage(unsigned int flags, int _sbz0, int _sbz1, int _sbz2, void *outbuf, size_t outlen);
301
307extern void OSSetLastError(kerrno_t err);
308
315
329extern void _SetLastError(kerrno_t err);
330
343
344#ifdef __cplusplus
345} // extern "C"
346#endif
347
348#endif
Common include file for all muteki-shims headers.
unsigned int kerrno_t
Definition errno.h:22
errno_ns_flag_e
Kernel errno namespace.
Definition errno.h:38
@ ERRNO_NS_APPLET_SPECIFIC
Definition errno.h:46
@ ERRNO_NS_KERNEL
Definition errno.h:42
@ ERRNO_NS_EXEC
Definition errno.h:44
@ ERRNO_NS_USER
Definition errno.h:40
errno_user_e
Error code for ERRNO_NS_USER.
Definition errno.h:120
@ THREADING_QUEUE_FULL
Definition errno.h:124
@ THREADING_SLOT_IN_USE
Definition errno.h:128
@ THREADING_INVALID_DESCRIPTOR
Definition errno.h:140
@ THREADING_SLOT_FULL
Definition errno.h:130
@ THREADING_STACK_MALLOC_FAILED
Definition errno.h:138
@ THREADING_STRUCT_MALLOC_FAILED
Definition errno.h:132
@ THREADING_DESCRIPTOR_BUSY
Definition errno.h:142
@ THREADING_QUEUE_BUSY
Definition errno.h:122
@ THREADING_THREAD_NOT_SUSPENDED
Definition errno.h:136
@ THREADING_QUEUE_EMPTY
Definition errno.h:126
@ THREADING_THREAD_NOT_SLEEPING
Definition errno.h:134
kerrno_t _GetLastError(void)
Get errno.
void _SetLastError(kerrno_t err)
Set errno.
message_flags_e
Flags for FormatMessage()
Definition errno.h:28
@ FORMAT_MESSAGE_FROM_SYSTEM
Definition errno.h:32
@ FORMAT_MESSAGE_ALLOCATE_BUFFER
Definition errno.h:30
errno_kernel_e
Error code for ERRNO_NS_KERNEL.
Definition errno.h:148
@ FS_INVALID_FILENAME
Definition errno.h:199
@ FS_FILE_LOCKED
Definition errno.h:217
@ FS_FILE_ATTR_ERROR
Definition errno.h:219
@ FS_NO_SPACE_LEFT
Definition errno.h:221
@ DB_INDEX_FULL_SYNC
Definition errno.h:257
@ FS_PATH_TOO_LONG
Definition errno.h:236
@ MKFS_UNSUPPORTED
Definition errno.h:187
@ SYS_ERASE_FAILED
Definition errno.h:176
@ MEDIUM_WP_ENABLED
Definition errno.h:163
@ MEDIUM_ERROR
Definition errno.h:169
@ MKFS_MODE_ERROR
Definition errno.h:191
@ FS_DIR_FULL_ALT1
Definition errno.h:244
@ FS_READ_ONLY_FILE
File is read-only.
Definition errno.h:229
@ PERIPHERAL_COMM_FAILED
Definition errno.h:150
@ MEDIUM_CHANGED
Definition errno.h:165
@ FTL_DATA_CORRUPTED
Definition errno.h:155
@ DB_CORRUPTED
Definition errno.h:249
@ SYS_LOW_BATTERY
Definition errno.h:180
@ MEDIUM_UNLOADED
Definition errno.h:171
@ FS_OPERATION_ERROR
Definition errno.h:201
@ FTL_INVALID_LBA
Definition errno.h:161
@ DB_INDEX_FULL_DELETE
Definition errno.h:253
@ MKFS_PROMPT
Definition errno.h:185
@ MKFS_NO_SPACE_LEFT
Definition errno.h:189
@ FS_INVALID_DRIVE_LETTER
Definition errno.h:196
@ FS_TOO_MANY_OPEN_FILES
Definition errno.h:215
@ MEDIUM_INCOMPATIBLE
Definition errno.h:167
@ DB_OPEN_FAILED
Definition errno.h:251
@ FS_FILE_UNAVAILABLE
Definition errno.h:209
@ FS_FILE_OOB_ACCESS
Definition errno.h:211
@ DB_TOO_MANY_OPEN_FILES
Definition errno.h:259
@ FTL_ECC_FAILED
Definition errno.h:157
@ MKFS_IO_ERROR
Definition errno.h:193
@ FS_DIR_FULL
Definition errno.h:205
@ DB_FULL
Definition errno.h:255
@ GENERAL_HW_ERROR
Definition errno.h:152
@ FS_DIR_FULL_ALT2
Definition errno.h:246
@ SYS_STORAGE_DEVICE_NOT_FOUND
Definition errno.h:174
@ FTL_ECC_TRIGGERED
Definition errno.h:159
@ SYS_OUT_OF_MEMORY
Definition errno.h:178
@ FS_GENERIC_ERROR
Generic error.
Definition errno.h:242
@ FS_ENTRY_EXISTS
Definition errno.h:203
@ FS_CONFLICTING_ATTR
Definition errno.h:213
@ SYS_LOCK_SWITCH_ENABLED
Definition errno.h:182
@ FS_WRITE_ONLY_FILE
File is write-only.
Definition errno.h:234
@ FS_NO_SUCH_ENTRY_ALT
Definition errno.h:224
@ FS_NO_SUCH_ENTRY
Definition errno.h:207
kerrno_t OSGetLastError(void)
Get errno value from the global errno variable.
errno_exec_e
Error code for ERRNO_NS_EXEC.
Definition errno.h:52
@ EXEC_BESTAPE_RELOC_FAILURE
Failed to load executable file due to an error originated from the relocator.
Definition errno.h:109
@ EXEC_UNSUPPORTED
Unsupported executable type.
Definition errno.h:58
@ EXEC_LOADER_FAILURE
Failed to parse executable file.
Definition errno.h:72
@ EXEC_OPEN_FAILED
Failed to open executable file.
Definition errno.h:68
@ EXEC_MAP_FULL
Executable mapping table is full.
Definition errno.h:96
@ EXEC_NOT_LOADED
Executable is not loaded.
Definition errno.h:114
@ EXEC_GENERIC_ERROR
Generic error.
Definition errno.h:90
@ EXEC_BESTAPE_LD_FAILURE
Failed to load executable file due to an error originated from the shared object loader.
Definition errno.h:105
@ EXEC_MP3_PLAYER_IS_RUNNING
Refuse to load an executable file because MP3 player is running in the background.
Definition errno.h:85
@ EXEC_MALLOC_FAILED
Failed to allocate memory when loading executable file.
Definition errno.h:76
@ EXEC_DECOMPRESSION_FAILED
Decompression failed.
Definition errno.h:80
@ EXEC_BESTAPE_HEADER_PARSER_FAILURE
Failed to load executable file due to an error originated from the header parser.
Definition errno.h:101
@ EXEC_INVALID
Invalid executable file.
Definition errno.h:64
size_t FormatMessage(unsigned int flags, int _sbz0, int _sbz1, int _sbz2, void *outbuf, size_t outlen)
Fetch an error message.
void OSSetLastError(kerrno_t err)
Set the global errno.