]> git.ipfire.org Git - thirdparty/util-linux.git/blame - mount/pivot_root.c
Imported from util-linux-2.10s tarball.
[thirdparty/util-linux.git] / mount / pivot_root.c
CommitLineData
22853e4a
KZ
1/* pivot_root.c - Change the root file system */
2
3/* Written 2000 by Werner Almesberger */
4
5
6#include <stdio.h>
7#include <linux/unistd.h>
8
66ee8158 9static
22853e4a
KZ
10_syscall2(int,pivot_root,const char *,new_root,const char *,put_old)
11
12
13int main(int argc,const char **argv)
14{
15 if (argc != 3) {
16 fprintf(stderr,"usage: %s new_root put_old\n",argv[0]);
17 return 1;
18 }
19 if (pivot_root(argv[1],argv[2]) < 0) {
20 perror("pivot_root");
21 return 1;
22 }
23 return 0;
24}