mirror of
https://gitlab.com/sortix/sortix.git
synced 2023-02-13 20:55:38 -05:00
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:
parent
8ef439b328
commit
c94f6b64c3
4 changed files with 4 additions and 4 deletions
|
@ -65,7 +65,7 @@ namespace Sortix
|
||||||
// space buffer is empty on the next call, so that'll probably
|
// space buffer is empty on the next call, so that'll probably
|
||||||
// succeed. The directory read function will store the number of
|
// succeed. The directory read function will store the number of
|
||||||
// bytes needed in the d_namelen variable and set errno to
|
// 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; }
|
if ( dir->Read(dirent, size) ) { return (prev) ? 0 : -1; }
|
||||||
|
|
||||||
// Insert the current dirent into the single-linked list for
|
// Insert the current dirent into the single-linked list for
|
||||||
|
|
|
@ -317,7 +317,7 @@ namespace Sortix
|
||||||
if ( available < needed )
|
if ( available < needed )
|
||||||
{
|
{
|
||||||
dirent->d_namelen = needed;
|
dirent->d_namelen = needed;
|
||||||
Error::Set(EINVAL);
|
Error::Set(ERANGE);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -184,7 +184,7 @@ namespace Sortix
|
||||||
if ( available < needed )
|
if ( available < needed )
|
||||||
{
|
{
|
||||||
dirent->d_namelen = needed;
|
dirent->d_namelen = needed;
|
||||||
Error::Set(EINVAL);
|
Error::Set(ERANGE);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -222,7 +222,7 @@ namespace Sortix
|
||||||
if ( available < needed )
|
if ( available < needed )
|
||||||
{
|
{
|
||||||
dirent->d_namelen = needed;
|
dirent->d_namelen = needed;
|
||||||
Error::Set(EINVAL);
|
Error::Set(ERANGE);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue