Skip to content

Instantly share code, notes, and snippets.

@Tilka
Created October 6, 2018 17:03
Show Gist options
  • Save Tilka/c35f65f73cae09209fd927836d345093 to your computer and use it in GitHub Desktop.
Save Tilka/c35f65f73cae09209fd927836d345093 to your computer and use it in GitHub Desktop.
for some reason closing evdev file descriptors takes ~30 ms on my laptop :/
#include <fcntl.h>
int main()
{
// leak 100 file descriptors, on exit the kernel will close them in one go
for (int i = 0; i < 100; ++i)
open("/dev/input/event0", O_RDONLY);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment