Created
February 28, 2014 08:27
-
-
Save EvanKrall/9267361 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
compile with
gcc -std=c99