diff options
author | Corinna Vinschen <corinna@vinschen.de> | 2023-11-25 22:56:52 +0300 |
---|---|---|
committer | Corinna Vinschen <corinna@vinschen.de> | 2023-11-28 12:55:52 +0300 |
commit | 8e009dce7c82538119766cc0e3a6c91f3248ea5a (patch) | |
tree | 7870b7eefabf87b27bd3ea18476027f709f8958f /winsup/cygwin/fhandler/base.cc | |
parent | 4a7cc5af01e438b33f6544d99548fe5f4d2cb776 (diff) |
Cygwin: posix_fallocate: return ENODEV
The fhandler method ftruncate returns either EISDIR if it has been
called on directories, or EINVAL if called on files other than
regular files. This matches what ftruncate(2) is supposed to return,
but it doesn't match posix_fallocate(3), which is supposed to return
ENODEV in both cases.
To accomplish that, return ENODEV from fhandler_base::ftruncate()
and convert it to EINVAL in ftruncate(2). In posix_fallocate(3),
convert EISDIR to ENODEV.
Fixes: 7636b58590621 ("* autoload.cc (NtSetInformationFile): Define.")
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
Diffstat (limited to 'winsup/cygwin/fhandler/base.cc')
-rw-r--r-- | winsup/cygwin/fhandler/base.cc | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/winsup/cygwin/fhandler/base.cc b/winsup/cygwin/fhandler/base.cc index 9b49ec7b9..58b63da8d 100644 --- a/winsup/cygwin/fhandler/base.cc +++ b/winsup/cygwin/fhandler/base.cc @@ -1705,7 +1705,7 @@ fhandler_base::fadvise (off_t offset, off_t length, int advice) int fhandler_base::ftruncate (off_t length, bool allow_truncate) { - return EINVAL; + return ENODEV; } int |