mirror of
https://github.com/genodelabs/genode.git
synced 2025-01-21 03:55:04 +00:00
vfs: add new error codes
The codes are OPEN_ERR_NAME_TOO_LONG, OPEN_ERR_NO_SPACE, and FTRUNCATE_ERR_NO_SPACE. Issue #1693
This commit is contained in:
parent
286edaed68
commit
1779a0511b
@ -297,12 +297,16 @@ Libc::File_descriptor *Libc::Vfs_plugin::open(char const *path, int flags,
|
||||
|
||||
case Result::OPEN_ERR_NO_PERM: errno = EPERM; return 0;
|
||||
case Result::OPEN_ERR_UNACCESSIBLE: errno = ENOENT; return 0;
|
||||
case Result::OPEN_ERR_NAME_TOO_LONG: errno = ENAMETOOLONG; return 0;
|
||||
case Result::OPEN_ERR_NO_SPACE: errno = ENOSPC; return 0;
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case Result::OPEN_ERR_NO_PERM: errno = EPERM; return 0;
|
||||
case Result::OPEN_ERR_EXISTS: errno = EEXIST; return 0;
|
||||
case Result::OPEN_ERR_NAME_TOO_LONG: errno = ENAMETOOLONG; return 0;
|
||||
case Result::OPEN_ERR_NO_SPACE: errno = ENOSPC; return 0;
|
||||
}
|
||||
}
|
||||
|
||||
@ -664,6 +668,7 @@ int Libc::Vfs_plugin::ftruncate(Libc::File_descriptor *fd, ::off_t length)
|
||||
switch (handle->fs().ftruncate(handle, length)) {
|
||||
case Result::FTRUNCATE_ERR_NO_PERM: errno = EPERM; return -1;
|
||||
case Result::FTRUNCATE_ERR_INTERRUPT: errno = EINTR; return -1;
|
||||
case Result::FTRUNCATE_ERR_NO_SPACE: errno = ENOSPC; return -1;
|
||||
case Result::FTRUNCATE_OK: break;
|
||||
}
|
||||
return 0;
|
||||
|
@ -51,6 +51,8 @@ struct Vfs::Directory_service
|
||||
OPEN_ERR_UNACCESSIBLE,
|
||||
OPEN_ERR_NO_PERM,
|
||||
OPEN_ERR_EXISTS,
|
||||
OPEN_ERR_NAME_TOO_LONG,
|
||||
OPEN_ERR_NO_SPACE,
|
||||
OPEN_OK
|
||||
};
|
||||
|
||||
|
@ -55,7 +55,8 @@ struct Vfs::File_io_service
|
||||
***************/
|
||||
|
||||
enum Ftruncate_result { FTRUNCATE_ERR_NO_PERM = NUM_GENERAL_ERRORS,
|
||||
FTRUNCATE_ERR_INTERRUPT, FTRUNCATE_OK };
|
||||
FTRUNCATE_ERR_INTERRUPT, FTRUNCATE_ERR_NO_SPACE,
|
||||
FTRUNCATE_OK };
|
||||
|
||||
virtual Ftruncate_result ftruncate(Vfs_handle *vfs_handle, file_size len) = 0;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user