9 ms·
> and you know C doesn't come with a handy data structure like a map to make this efficient and easy when scaling to say 100k+ fds. There's plenty of map like
by toast0 3y ago
> and you know C doesn't come with a handy data structure like a map to make this efficient and easy when scaling to say 100k+ fds.
There's plenty of map like things available; not in the language standard, but in libcs or os includes, but fds are ints, and kernel APIs that return 'new' fds are contracted to return you the least numerical fd that isn't currently in use... So you can set a max fds (the OS will tell you if you ask), and set an array of that size.