4 ms·
fds should have been IPv6 addresses. I will not elaborate on why or how.
by jchw 2mo ago
fds should have been IPv6 addresses. I will not elaborate on why or how.
- actionfromafar 2mo agoIt's such a common problem to write to a stale file descriptor. It may be closed which is fine, at least you will have an obvious error. But what's much worse is when the stale descriptor actually works, because something else in the program opened a new fd and your stale descriptor is not stale anymore, it just points at something unexpected. Opaque handles are often a blessing. Maybe UUID would be overkill (it certainly would have been back in the day of 16-bit unix machines) but something fairly large would have helped a lot. Even just incrementing and rolling over a 16-bit value would have helped, instead of situations such as closing stdout and stderr, opening a file, and now random error logs sprinkle into your PDF or whatever. Yes, "you are holding it wrong", but it should be hard to "hold it wrong", not easy.
- jchw 2mo agoJoking aside I pretty much agree with this. Windows NT Object handles work pretty well. I assume they are pointers of some kind under the hood, but either way a machine word is probably large enough as it seems unlikely you would ever need to handle more open handles than you have bytes of addressable memory.