pub fn drop_nonblock(file: File) -> Result<File>Expand description
Drop the O_NONBLOCK flag from an open file
This function takes ownership of the File to ensure that no other references
to this specific file handle exist within the current scope while the flags are
being modified. This mitigates race conditions where other threads might be
attempting to read/write to the file or modify its flags concurrently via the
same handle.
§Platform Behavior
- Unix: Uses
fcntlto clearO_NONBLOCK. - Windows: No-op (Windows file handles do not use
O_NONBLOCKin the same way).
§Errors
Returns an error if the underlying syscall fails.