by extension, however, the point is that any resource that can possibly interact with mach should be backed by resources accessible by mach. e.g. kernel handles of all kinds.
it is, admittedly possible that apple has decided to something far more cursed, like translate resources to be accessible by the mach layer as needed, but this seems far more complicated than just backing all kernel resources by mach ports to begin with
@bugaevc @marcan @nicolas17
though it seems that you're right that file handles do not normally have mach ports on Darwin (which is surprising to me):
a program which does nothing has 11 ports opened. modify that program to open a file and it still only has 11 ports opened.
🤷