Closed magicant closed 1 month ago
The recent updates to the system
module enhance API clarity and type safety by transitioning from custom data structures to more idiomatic Rust types like vectors. Key method signatures have been revamped to utilize Vec<Fd>
over FdSet
, facilitating easier management of file descriptors. These changes improve encapsulation and overall efficiency, aligning the code more closely with modern Rust conventions and potentially affecting existing implementations.
Files | Change Summary |
---|---|
yash-env/src/system.rs |
Removed fd_set module; updated select method to accept Vec<Fd> instead of FdSet . |
yash-env/src/system/real.rs |
Altered select method to accept Vec<Fd> for readers and writers, aligning with changes in system.rs . |
yash-env/src/system/select.rs |
Changed readers and writers methods to return Vec<Fd> instead of FdSet ; updated wake method to accept slices of Fd . |
yash-env/src/system/shared.rs |
Modified select method signatures for &SharedSystem and SharedSystem to use Vec<Fd> instead of FdSet . |
yash-env/src/system/virtual.rs |
Updated select method to handle Vec<Fd> ; refined validation and filtering logic for file descriptors. |
yash-env/src/system.rs |
Changes in signal mask handling and updated parameter types for methods like sigmask , dup , and fcntl_ functions for improved type safety and clarity. |
sequenceDiagram
participant User
participant System
participant RealSystem
User->>System: Call select(readers, writers, timeout)
System->>RealSystem: Process selection
RealSystem->>RealSystem: Validate FDs
RealSystem->>RealSystem: Retain ready FDs
RealSystem-->>User: Return selected FDs
π° In a world of code and hops,
The rabbit dances, never stops.
With vectors bright and types so clear,
We celebrate this change, oh dear!
A leap for safety, a joyful cheer!
Huzzah for Rust, letβs all revere! π
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?
Summary by CodeRabbit
New Features
FdSet
toVec<Fd>
, enhancing flexibility and performance in file operations.Bug Fixes
Tests