kubkon commented on Issue #1329:
@sunfishcode I've applied the tweaks to the design as discussed offline on Zulip. Here's the summary of the changes:
The underlying type in
FdPoolwhich we use to track and represent raw file descriptors is nowu32. As a result, the structure ofFdPoolis simplified massively as we no longer need to track the claimed descriptors; in a way, we trust the caller to return the handle after it's done with it. In case the caller decides to be clever and return a handle which was not yet legally allocated, we panic. This should never be a problem inwasi-commonunless we hit a bug.To make all of this work,
Fdtrait is modified to require two methods:as_raw(&self) -> u32andfrom_raw(raw_fd: u32) -> Selfboth of which are used to convert to and from theFdPool's underlying typeu32.
Last updated: Dec 13 2025 at 21:03 UTC