4 ms·
I want an alternative unix ABI that doesn't guarantee lowest-reuse for this exact reason. I suppose you could (almost) just hijack the close call and replace i
by loeg 1y ago
I want an alternative unix ABI that doesn't guarantee lowest-reuse for this exact reason. I suppose you could (almost) just hijack the close call and replace it with a dup2 of /dev/null or something (but then you'd miss close errors).
- the8472 1y agoIt could be emulated in userspace with F_DUPFD. But that's costly because the kernel table is optimized for dense data, not sparse. The rust standard library aborts the program in debug builds when it detects a double-close; at that point corruption may already have occurred but better than nothing.
- loeg 1y ago> The rust standard library aborts the program in debug builds when it detects a double-close On EBADF? Neat.