by jdsully · 7y ago · 0 comments
FDs are pretty much HANDLEs of the nix world.
We are going to soon: "The 5.3 kernel also adds the ability to pass a pidfd to poll(), which will provide a notification when the process represented by that pidfd exits." (https://lwn.net/SubscriberLink/794707/905eb6b5b7287e77/)
[1] https://stackoverflow.com/questions/8057892/epoll-on-regular...
The VMS and NT philosophies of everything being an object are a bit more general and easier to follow in practice.
In fact windows actually reserves a block of user address space that will never be allocated to disambiguate memory vs non memory handles.
Its really a pitty these two great systems refuse to learn from each other.
"File descriptor" is just a weird spelling of "handle", for historical reasons.
Futex is a special case because futexes themselves are quite special. There is no userspace equivalent to them in Windows anyway as has been mentioned. Windows Events are similar to what is provided by eventfd, but not as featureful.
It's also not something that works on all Unices (e.g. afaik macos has no timerfd). But in all fairness, that problem only exists because OS speciation, as it's biological counterpart, is not as clear cut a concept as one would desire.