diff --git a/sortix/directory.cpp b/sortix/directory.cpp index 3040c435..e37f9598 100644 --- a/sortix/directory.cpp +++ b/sortix/directory.cpp @@ -65,7 +65,7 @@ namespace Sortix // space buffer is empty on the next call, so that'll probably // succeed. The directory read function will store the number of // bytes needed in the d_namelen variable and set errno to - // EINVAL such that userspace knows we need a larger buffer. + // ERANGE such that userspace knows we need a larger buffer. if ( dir->Read(dirent, size) ) { return (prev) ? 0 : -1; } // Insert the current dirent into the single-linked list for diff --git a/sortix/fs/devfs.cpp b/sortix/fs/devfs.cpp index 634fa9fa..bf24018e 100644 --- a/sortix/fs/devfs.cpp +++ b/sortix/fs/devfs.cpp @@ -317,7 +317,7 @@ namespace Sortix if ( available < needed ) { dirent->d_namelen = needed; - Error::Set(EINVAL); + Error::Set(ERANGE); return 0; } diff --git a/sortix/fs/initfs.cpp b/sortix/fs/initfs.cpp index 5578ac8b..1cf74921 100644 --- a/sortix/fs/initfs.cpp +++ b/sortix/fs/initfs.cpp @@ -184,7 +184,7 @@ namespace Sortix if ( available < needed ) { dirent->d_namelen = needed; - Error::Set(EINVAL); + Error::Set(ERANGE); return 0; } diff --git a/sortix/fs/ramfs.cpp b/sortix/fs/ramfs.cpp index 0879db4f..ff759c7d 100644 --- a/sortix/fs/ramfs.cpp +++ b/sortix/fs/ramfs.cpp @@ -222,7 +222,7 @@ namespace Sortix if ( available < needed ) { dirent->d_namelen = needed; - Error::Set(EINVAL); + Error::Set(ERANGE); return 0; }