Skip to content

Instantly share code, notes, and snippets.

@EvanKrall
Created February 28, 2014 08:27
Show Gist options
  • Save EvanKrall/9267361 to your computer and use it in GitHub Desktop.
Save EvanKrall/9267361 to your computer and use it in GitHub Desktop.
#include <stdio.h>
#include <sys/stat.h>
#include <sys/types.h>
#include <sys/mount.h>
#include <stdlib.h>
int main(int argc, char **argv) {
mkdir("/mnt/aufs", 0755);
mkdir("/tmp/br1", 0755);
mkdir("/tmp/br2", 0755);
for (int i=0; 1; i++) {
if (i % 100 == 0) {
printf("iteration %d\n", i);
}
int error = mount("none", "/mnt/aufs", "aufs", 0, "br=/tmp/br1:/tmp/br2");
if (error) {
printf("mount error on iteration %d: %d\n", i, error);
exit(error);
}
error = umount("/mnt/aufs");
if (error) {
printf("umount error on iteration %d: %d\n", i, error);
exit(error);
}
}
}
@EvanKrall
Copy link
Author

compile with gcc -std=c99

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment