secondary cache feature in vm.
[minix.git] / commands / simple / chroot.c
blobf9758de4f13bf66f12d086003874308af7adbf93
2 #include <unistd.h>
3 #include <stdio.h>
4 #include <stdlib.h>
6 #include <sys/wait.h>
8 int
9 main(int argc, char *argv[])
11 int status;
13 if(argc != 3) {
14 fprintf(stderr, "usage: %s <root> <command>\n", argv[0]);
15 return 1;
18 if(chroot(argv[1]) < 0) {
19 perror("chroot");
20 return 1;
23 status = system(argv[2]);
24 if(WIFEXITED(status))
25 return WEXITSTATUS(status);
26 return 1;