readdirents(2) now returns ERANGE if insufficient storage space

was provided, but that the needed size could be copied to d_namelen.
This commit is contained in:
Jonas 'Sortie' Termansen 2012-01-14 23:06:18 +01:00
parent 8ef439b328
commit c94f6b64c3
4 changed files with 4 additions and 4 deletions

View File

@ -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

View File

@ -317,7 +317,7 @@ namespace Sortix
if ( available < needed )
{
dirent->d_namelen = needed;
Error::Set(EINVAL);
Error::Set(ERANGE);
return 0;
}

View File

@ -184,7 +184,7 @@ namespace Sortix
if ( available < needed )
{
dirent->d_namelen = needed;
Error::Set(EINVAL);
Error::Set(ERANGE);
return 0;
}

View File

@ -222,7 +222,7 @@ namespace Sortix
if ( available < needed )
{
dirent->d_namelen = needed;
Error::Set(EINVAL);
Error::Set(ERANGE);
return 0;
}