All the targets that use use_file support AtomicI32. Using AtomicI32 eliminates as conversions and thus avoids any possibility of truncation or confusion between FD_UNINIT and a valid file descriptor.
Use -1 as the sentinel value for FD_UNINIT since libstd (only) guarantees that -1 is not a valid file descriptor value.
All the targets that use
use_file
supportAtomicI32
. UsingAtomicI32
eliminatesas
conversions and thus avoids any possibility of truncation or confusion betweenFD_UNINIT
and a valid file descriptor.Use -1 as the sentinel value for
FD_UNINIT
since libstd (only) guarantees that -1 is not a valid file descriptor value.Minimize the scope of
FD_UNINIT
.