Re: How is pivot_root intended to be used?

2014-09-04 Thread Steven Stewart-Gallus
Thank you, I think I will change the code to be like: int old_root = open("/", O_DIRECTORY); if (-1 == old_root) { perror("open"); return EXIT_FAILURE; } if (-1 == syscall(__NR_pivot_root, ".", ".")) { perror("pivot_root"); return EXIT_FAILURE;

Re: How is pivot_root intended to be used?

2014-09-04 Thread Steven Stewart-Gallus
Thank you, I think I will change the code to be like: int old_root = open(/, O_DIRECTORY); if (-1 == old_root) { perror(open); return EXIT_FAILURE; } if (-1 == syscall(__NR_pivot_root, ., .)) { perror(pivot_root); return EXIT_FAILURE; } if

Re: How is pivot_root intended to be used?

2014-09-02 Thread Andy Lutomirski
On 09/01/2014 02:19 PM, Steven Stewart-Gallus wrote: Hello, I am not confused about how I can currently use pivot_root for containers on my kernel (version 3.13). Currently a sequence like: if (-1 == syscall(__NR_pivot_root, ".", ".")) { perror("pivot_root"); return

Re: How is pivot_root intended to be used?

2014-09-02 Thread Andy Lutomirski
On 09/01/2014 02:19 PM, Steven Stewart-Gallus wrote: Hello, I am not confused about how I can currently use pivot_root for containers on my kernel (version 3.13). Currently a sequence like: if (-1 == syscall(__NR_pivot_root, ., .)) { perror(pivot_root); return

How is pivot_root intended to be used?

2014-09-01 Thread Steven Stewart-Gallus
Hello, I am not confused about how I can currently use pivot_root for containers on my kernel (version 3.13). Currently a sequence like: if (-1 == syscall(__NR_pivot_root, ".", ".")) { perror("pivot_root"); return EXIT_FAILURE; } if (-1 == umount2(".", MNT_DETACH)) {

How is pivot_root intended to be used?

2014-09-01 Thread Steven Stewart-Gallus
Hello, I am not confused about how I can currently use pivot_root for containers on my kernel (version 3.13). Currently a sequence like: if (-1 == syscall(__NR_pivot_root, ., .)) { perror(pivot_root); return EXIT_FAILURE; } if (-1 == umount2(., MNT_DETACH)) {