fs:add _POSIX_OPEN_MAX limit to files_extend
Signed-off-by: 田昕 <tianxin7@xiaomi.com>
This commit is contained in:
parent
0460367a70
commit
b53bbb15c5
|
@ -71,6 +71,11 @@ static int files_extend(FAR struct filelist *list, size_t row)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (row * CONFIG_NFILE_DESCRIPTORS_PER_BLOCK > _POSIX_OPEN_MAX)
|
||||||
|
{
|
||||||
|
return -EMFILE;
|
||||||
|
}
|
||||||
|
|
||||||
tmp = kmm_realloc(list->fl_files, sizeof(FAR struct file *) * row);
|
tmp = kmm_realloc(list->fl_files, sizeof(FAR struct file *) * row);
|
||||||
DEBUGASSERT(tmp);
|
DEBUGASSERT(tmp);
|
||||||
if (tmp == NULL)
|
if (tmp == NULL)
|
||||||
|
|
Loading…
Reference in New Issue