Skip to content

13MAY24: Fixed directory reading using FAM to conserve RAM (#546)

Choose a tag to compare

@maishuji maishuji released this 13 May 16:40
· 1801 commits to master since this release
39ade8b
* Fixed directory reading using FAM to conserve RAM

- The zero-sized array approach that was tried previously was apparently
  causing undefined behavior since it was not the last member of the DIR
  structure, when calling readdir()
- Modified it back to using a FAM, except this time got it working with
  C++ (and GNU extensions), by using a unionization of the inner dirent
structure along with an additional extension to hold the name.

* Fixed handling NULL terminator for NAME_MAX.

The POSIX NAME_MAX is not supposed to be the array capacity for the
name, it's supposed to be the MAX STRING LENGTH, meaning we also must
have one extra byte for a NULL terminator!

---------