Linux – How to detect end-of-file when using open/read

c++linux

I am using open/read functions, there's feof for fopen/fread to detect end-of-file, what's the equivalent way for open/read?

Best Solution

From man read:

On success, the number of bytes read is returned (zero indicates end of file), ...