26 lines
445 B
C
26 lines
445 B
C
#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;
|
|
}
|
|
}
|