https://bugs.kde.org/show_bug.cgi?id=331311

--- Comment #14 from Mark Wielaard <[email protected]> ---
(In reply to Mark Wielaard from comment #13)
> This is kind of tricky to test for.

But there is an example in
https://www.man7.org/linux/man-pages/man2/getdents.2.html#EXAMPLES
You could use that with a really small BUF_SIZE to test some things.

I think the filter_valgrind_fds_from_getdents_with_refill functions should
return a SysRes instead of a SizeT so you can also return a failing (retry)
syscall. And in the retry you don't have to check for remaining_buf >
sizeof(struct vki_dirent), if new_size = 0 then none of the buffer has been
used to store results (everything filtered out). If the buffer turns out to be
too small now (unlikely, but could happen) then the syscall will fail with
EINVAL. Just return that to the program/user and they will have to extend the
buffer.

-- 
You are receiving this mail because:
You are watching all bug changes.

Reply via email to