lib: fs: implement mounting filesystems; reading, writing from files
This commit is contained in:
25
lib/libfs/status.c
Normal file
25
lib/libfs/status.c
Normal file
@@ -0,0 +1,25 @@
|
||||
#include <errno.h>
|
||||
#include <fs/status.h>
|
||||
|
||||
int fs_status_to_errno(enum fs_status status)
|
||||
{
|
||||
switch (status) {
|
||||
case FS_SUCCESS:
|
||||
return SUCCESS;
|
||||
case FS_ERR_NO_ENTRY:
|
||||
return ENOENT;
|
||||
case FS_ERR_NO_MEMORY:
|
||||
return ENOMEM;
|
||||
case FS_ERR_INVALID_ARGUMENT:
|
||||
return EINVAL;
|
||||
case FS_ERR_NOT_IMPLEMENTED:
|
||||
return ENOSYS;
|
||||
case FS_ERR_IS_DIRECTORY:
|
||||
return EISDIR;
|
||||
case FS_ERR_NOT_DIRECTORY:
|
||||
return ENOTDIR;
|
||||
|
||||
default:
|
||||
return EINVAL;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user