Open aaronjeline opened 1 month ago
Looks like this is an issue with MacOS poll()
, doesn't seem like it supports block devices. (https://nathancraddock.com/blog/macos-dev-tty-polling/).
I'm happy to work on supporting this, I see two ways of going about it, not sure which you think is best?
1) Special case the handling of block devices, and use select
for them.
2) Spawn a new thread for monitoring blocks devices, use select
in that thread, and pipe data from that to the main thread, monitor that second thread as normal with poll
If you have better ideas I'm also happy to hear that.
Oh wow, that's annoying. I guess we need to do what libuv does then and use select
when polling fails (https://github.com/libuv/libuv/blob/731adacad2426d349d4c51ca608184f7e01c93c6/src/unix/stream.c#L287).
https://lists.apple.com/archives/Darwin-dev/2006/Apr/msg00066.html
There's an issue with binary compatibility inside the kernel that prevented it being fixed in Tiger, but hopefully it can be sorted in Leopard because it's an ongoing headache.
sorted in Leopard
lol. Like I said, happy to hack on this if you'd like me to
Blog post on the trick uv
does, I'll start down this road: https://code.saghul.net/2016/05/libuv-internals-the-osx-select2-trick/
Sounds good!
Attempting to use
Eio.Flow.copy_string
when stdout points to/dev/null
crashes.main.ml
:dune
:Interacting with it: