diff --git a/Kernel/Syscalls/fallocate.cpp b/Kernel/Syscalls/fallocate.cpp index 820d86301c..18269c061d 100644 --- a/Kernel/Syscalls/fallocate.cpp +++ b/Kernel/Syscalls/fallocate.cpp @@ -37,7 +37,8 @@ ErrorOr Process::sys$posix_fallocate(int fd, Userspace us if (description->is_fifo()) return ESPIPE; - if (!S_ISREG(TRY(description->file().stat()).st_mode)) + // [ENODEV] The fd argument does not refer to a regular file. + if (!description->file().is_regular_file()) return ENODEV; VERIFY(description->file().is_inode());