[PATCH v3] close_range: fd and max_fd are unsigned

Dmitry V. Levin ldv at altlinux.org
Wed May 5 23:36:41 UTC 2021


On Wed, May 05, 2021 at 05:53:07PM +0000, Alyssa Ross wrote:
> The distinction is important, because close_range(2) says that having
> max_fd < fd is an error, but if you give the kernel 1U + INT_MAX as
> max_fd, it'll interpret it as unsigned.
> 
> Since we're working with ranges of file descriptors here, the
> particular properties of only the start and end file descriptors
> aren't really relevant, so it doesn't matter that we're losing fancy
> file descriptor printing in making this change.
> ---
> v1: https://lists.strace.io/pipermail/strace-devel/2021-March/010459.html
> v2: https://lists.strace.io/pipermail/strace-devel/2021-May/010535.html
> 
> Changes since v2: use e.g. -1U in place of 4294967295 in test.

Applied, thanks.


-- 
ldv


More information about the Strace-devel mailing list