Skip to content

Support creating Async without setting non-blocking mode #132

Closed
@h33p

Description

@h33p

I have a project aims to be pluggable into different async executors through FDs/Handles. It works great, I have a PoC working with tokio. It also works on linux with smol. Example of how I'm using Async.

However, on macOS I'm getting ENOTTY, which stems from Async::new unconditionally running fcntl to set O_NONBLOCK, even on FDs that do not support it (like kqueue).

My usecase of Async is purely to have async-io poll for read-readiness of the FD, and have my task woken up. That's the whole extent of it. Maybe it would make sense to expose a different type just for polling, but the simpler way would be to add an overload for Async::new that allows making fcntl call conditional.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions