minix/commands/simple/chroot.c
2005-04-21 14:53:53 +00:00

23 lines
285 B
C

#include <unistd.h>
#include <stdio.h>
#include <stdlib.h>
int
main(int argc, char *argv[])
{
if(argc != 3) {
fprintf(stderr, "usage: %s <root> <command>\n", argv[0]);
return 1;
}
if(chroot(argv[1]) < 0) {
perror("chroot");
return 1;
}
system(argv[2]);
return 0;
}