You are right. I get the same error too if I try to scan files larger than 4gb. Hence why I linked the source code of LibClamAV. I think there is a bug where it tries to read file descriptor, but in the process it also tries to allocate memory leading to fmap errors due to hitting 4000M limit. This is just based on a quick read through of their c header files, but I haven’t coded c for years, so I might be completely wrong. Also, Cisco doesn’t seem to respond to “issues” on github.
If anyone else has insights, please share.
I am curious how @Squid utilizes this.