Skip to content

Instantly share code, notes, and snippets.

@eam
Created October 10, 2017 21:57
Show Gist options
  • Save eam/35a7ad1836bbd1cf7219183a7040b362 to your computer and use it in GitHub Desktop.
Save eam/35a7ad1836bbd1cf7219183a7040b362 to your computer and use it in GitHub Desktop.
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <unistd.h>
char buf[4096];
int main() {
int fd;
fd = open("/dev/null", O_WRONLY);
for (int i = 0; i < (1 << 25); i++) {
write(fd, buf, 4096);
}
close(fd);
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment