Skip to content

Instantly share code, notes, and snippets.

@fooker
Last active August 29, 2015 14:08
Show Gist options
  • Save fooker/e17874eeeddf078a10a4 to your computer and use it in GitHub Desktop.
Save fooker/e17874eeeddf078a10a4 to your computer and use it in GitHub Desktop.
Outer limits
#include <stdio.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
int main(int argc, char* argv[]) {
int count = 0;
while (open("/dev/null", O_RDONLY) != -1) {
count++;
if (count % 1000 == 0) {
printf("C: %d\n", count);
}
}
printf("R: %d\n", count);
printf("P: %d\n", getpid());
getchar();
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment