Skip to content

Instantly share code, notes, and snippets.

@stiletto
Created August 12, 2012 23:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save stiletto/3335416 to your computer and use it in GitHub Desktop.
Save stiletto/3335416 to your computer and use it in GitHub Desktop.
/*
* shitter.c
*
* % gcc -o shitter shitter.c -D_LARGEFILE64_SOURCE=1
*
*/
#include <stdio.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
int main(int argc, char *argv[]) {
if (argc<2) {
printf("Usage: %s <device>\n",argv[0]);
return 2;
}
int a = open(argv[1], O_RDONLY|O_NONBLOCK|O_LARGEFILE);
if (a<=0) {
perror("open");
return 1;
}
while(1) sleep(1000000);
close(a);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment