Re: New --track-fds=new option expected behaviour

Florian Weimer <[email protected]> Wed, 25 Dec 2024 13:36:41 +0100
Newsgroups gmane.comp.debugging.valgrind
Message-ID <[email protected]>
* Alexandra Petlanova Hajkova:

> The other question is, how should the new option be called? Is "new" a good
> name for it? Other options could be --track-fds=high or even
> --track-fds=random.

Is this really related to descriptor tracking, though?

I would expected a separate option, with a couple of choices:

  min (the POSIX default)
  max (what you call new)
  oldest (first no reuse; after running out of numbers, oldest close first)
  random
  strict-max
  strict-oldest
  strict-random

The difference between the strict-* and plain variants would be that
the plain variants check first if any of 0, 1, 2 are unallocated.  In
that case, they are like min/POSIX.  I suspect that should fix pretty
much all compatibility issues with max/oldest/random modes.