readdir()only reads 32K of directory entries at a time.
Why does it read only 32K entries in one shot? Is it dependent on buffer or any other parameters?
Can I change that value so that I can read as many directory entries as I want?
The maximum number of directories is file system dependent:
dir_nlinkflag to increase this number
It's only since 2006 when
ext4 was ratified that max directory limits were increased above 32000 mark, so there would be no point for
readdir() to read more than that.
If you have more than 32000 subdirectories, I would consider learning about performance degradation due to large amount of subdirectoies