you can use the offset parameter to count the read.
According to the Man page
If the offset is not NULL, it points to a variable containing the file offset from which sendfile () will start reading data from in_fd. When sendfile () returns, this variable will be set to a byte offset after the last byte that was read. If offset is not NULL, then sendfile () does not change the current file offset in_fd; otherwise, the current file offset is adjusted to display the number of bytes read from in_fd.
count - the number of bytes to copy between file descriptors.
RETURN VALUE If the transfer is successful, the number of bytes written to out_fd is returned. On error, -1 is returned, and errno is set accordingly.
and yes, which means that a return value of 0 means that there is no data copied for the socket entry.
source share