Module fd_list

Module fd_list 

Source
Expand description

A very simple data structure for holding the FDs a WASI process is using. Keeps track of the first unused (i.e. freed) FD, which is slightly faster than doing a linear search of the entire array each time. Note, The Unix spec requires newly allocated FDs to always be the lowest-numbered FD available.

Mutating methods (insert, remove, insert_first_free, etc.) update InodeGuard handle counts via acquire_handle / drop_one_handle. Callers must hold WasiFs::fd_map write-locked for the duration of any sequence that must be atomic with respect to concurrent open/close. Lock order: fd map before inode (see module comment in mod.rs).

Structsยง

FdList
FdListIterator
FdListIteratorMut