3 ms·
Isn’t this the whole point of using file descriptors? As long as you have an open file descriptor, the kernel resource it references should remain stable. And i
by 10000truths 5y ago
Isn’t this the whole point of using file descriptors? As long as you have an open file descriptor, the kernel resource it references should remain stable. And if the resource is unexpectedly destroyed from under the process’s nose, the file descriptor should report an I/O error the next time you try to read or write from it.
- masklinn 5y ago> Isn’t this the whole point of using file descriptors? Opening the same file multiple times will yield different fds, and the paths can be modified independently of the fd. The goal here is to find if: 1. there are new input devices 2. which are joysticks (a category which, for SDL, includes gamepads, so basically "has the user plugged in a new gamepad they might want to use for the game") How would keeping a bunch of fds around help?